Check when transaction was added to the mempool?

0

I know how to check when a specific transaction was included in the block. But how do I check when my bitcoind node first saw it? I would like to estimate for how long the transaction stayed unconfirmed after it was broadcasted.

Dmitry Laptev

Posted 2019-05-02T14:32:19.803

Reputation: 436

Answers

2

The getrawmempool interface provides this information in the time field, though it is potentially very slow to respond with a large number of transactions in the mempool. It does not record this time once the transaction is removed from the mempool for non-wallet transactions, so it either needs to be gathered from this interface or recorded on addition with the zmq socket.

"result": {
    "89ee39117b4b55e54ace29c631eef80a875ae109a4fbd79ddd10b6f21329e88d": {
        "size": 225,
        "fee": 0.00000573,
        "modifiedfee": 0.00000573,
        "time": 1556802637,
        "height": 574268,
        "descendantcount": 2,
        "descendantsize": 451,
        "descendantfees": 3247,
        "ancestorcount": 1,
        "ancestorsize": 225,
        "ancestorfees": 573,
        "wtxid": "89ee39117b4b55e54ace29c631eef80a875ae109a4fbd79ddd10b6f21329e88d",
        "depends": [

        ]
    }
}

Anonymous

Posted 2019-05-02T14:32:19.803

Reputation: 10 054

3Doesn't getmempoolentry give the same information?Pieter Wuille 2019-05-02T16:16:15.113

I assumed they wanted to do bulk analysis.Anonymous 2019-05-02T16:43:46.600

Thank you both, these are the useful commands One clarification though: am I right that once the transaction is confirmed and gone from the mempool- there is no way to check when it was first seen?Dmitry Laptev 2019-05-02T19:28:04.210

2Yes, that information is not kept around. In fact, apart from historical blocks (and only when not pruning), nothing at all is kept around about confirmed transactions (in general you can't test whether a particular transaction was confirmed in the past).Pieter Wuille 2019-05-02T19:34:38.097