Currently, we store the time transactions enter the mempool (in CTXMempoolEntry
) as a timestamp with second precision.
This patch stores data more precisely (microsecond granularity), as well as optionally storing the timestamp of the first inventory message received about each transaction in the pool, while still maintaining the previous interface for backwards compatibility (nTime
is unchanged, and nTimeUs
and nFirstInvTime
are added with microsecond precision).
This is really useful when measuring transaction propagation (e.g. in simulated networks) since there is no easy way of checking when a transaction was first announced or received by the node.
I’ve tried to make the change as minimal as possible, hence why the use of an intermediate map in PeerManager
instead of passing the time down to ProcessValidTx
, which in turn would require adding it to ProcessOrphanTx
, ProcessNewPackage
, …