how to get Received Time of Transaction in validation.cpp bitcoin core

1

for research purpose i needed Transaction hash,size, fee and received time. i have already managed to get hash, size and fee but unable to get time. what to do?

Shehreyar

Posted 2017-07-10T06:55:12.640

Reputation: 13

Answers

2

Transactions do not have a time. There is a time that your node received the transaction, but that is not necessarily the time that the transaction was originally broadcast.

To get the time of a transaction being accepted to your node's mempool, you can add debug=mempool to your bitcoin.conf file and then restart Core. Then grep through the debug.log file for any lines of the form "AcceptToMemoryPool: peer=%d: accepted %s (poolsz %u txn, %u kB). Since all lines have a time logged with them, you can get the time that a transaction was accepted to your node's mempool. However this will not include any transactions that are first received in a block.

Andrew Chow

Posted 2017-07-10T06:55:12.640

Reputation: 40 910

If transactions do not have a time. then how blockchain.info shows Received Time. what if i use UNIX time for transactions that are being accepted by my node????Shehreyar 2017-07-11T05:49:08.370

3blockchain.info displays the time that their node received the transaction. That is not necessarily the time that the transaction was broadcast to the network. The time that they display also changes; when a transaction is confirmed, they set the time to the timestamp of the block it was included in.Andrew Chow 2017-07-11T05:51:09.277