<p>You can use either <code>getrawmempool</code> (for all mempool transactions) or <code>getmempoolentry</code> (for individual transactions) to get the exact time a transaction was accepted into your node's mempool:</p>
<blockquote>
<p><code>&quot;time&quot;</code>: xxx,                         (numeric) local time transaction
entered pool in seconds since 1 Jan 1970 GMT</p>
</blockquote>
<p>You can also listen for the <code>hashtx</code> ZeroMQ event and store the time when that event was received. Storing timestamps is something you will need to do anyway, since when the transaction becomes confirmed, Bitcoin Core seems to immediately discard the mempool entry data.</p>

CC BY-SA 4.0
2022-12-08T13:37:26.133Z
Thank you for your answer. But those solutions imply that transactions to be analyzed are new. If I need to fetch transaction latency for some 2014 transactions, how do I do? Is that possible?
ted
CC BY-SA 4.0
2022-12-08T13:43:26.277Z
No, that's not possible, unless you can find someone who collected this data back in 2014 to give it to you, and you also have no way to make sure this data is correct.
Vojtěch Strnad
CC BY-SA 4.0
2022-12-08T13:25:37.543Z
2022-12-08T13:25:37.543Z
Vojtěch Strnad
<p>As a useful info for who might be needing such data, I have found out that that using <a href="https://www.blockchain.com/explorer/api/blockchain_api" rel="nofollow noreferrer">blockchain.info</a> APIs, information about latency on newer transactions can be fetched. In fact, if we try to query BTC core node:</p>
<pre><code>getrawtransaction &quot;614095eeb59da281af6d49d85a153bfd8ec41acca272289e49bc6bd60b7ac7f6&quot; true
</code></pre>
<p>we notice that <code>&quot;time&quot;: 1669848740</code>, equals to <code>&quot;blocktime&quot;</code> one. However, if we query blockchain.info APIs, we obtain <code>&quot;time&quot;:1669848666</code>, giving us a latency of 74 seconds.</p>

CC BY-SA 4.0
2022-12-09T10:54:11.303Z
2022-12-09T10:54:11.303Z
ted
<p>I am running a BTC core node and I would like to perform some experiments and analysis on Bitcoin transaction latency. However, I see that the method <code>getrwatransaction</code> returns an object with:</p>
<blockquote>
<p><code>&quot;blocktime&quot;</code> : xxx, (numeric) The block time expressed in UNIX epoch time</p>
<p><code>&quot;time&quot;</code> : n, (numeric) <strong>Same as &quot;blocktime&quot;</strong></p>
</blockquote>
<p>As I would like to get information on transaction latency, in a way that I can subtract the first appearance of such transaction in the mempool with the block creation epoch, those two parameters should not be the same, otherwise I only see it as a redundant and useless information.</p>
<p>Is there a way to get such piece of information? I see that mempool does not store (obviously) all the record of received transactions, so I was wondering whether such information is stored in the transaction itself, or if it is possible to get it somehow.</p>

<bitcoin-core><transactions><mempool><timestamp><latency>
Is it possible to check latency of already approved transactions?
ted
# Is it possible to check latency of already approved transactions?

(Asked by: username_0 on 2022-12-08)

I am running a BTC core node and I would like to perform some experiments and analysis on Bitcoin transaction latency. However, I see that the method `getrwatransaction` returns an object with:

> `"blocktime"` : xxx, (numeric) The block time expressed in UNIX epoch time
>
> `"time"` : n, (numeric) **Same as "blocktime"**

As I would like to get information on transaction latency, in a way that I can subtract the first appearance of such transaction in the mempool with the block creation epoch, those two parameters should not be the same, otherwise I only see it as a redundant and useless information.

Is there a way to get such piece of information? I see that mempool does not store (obviously) all the record of received transactions, so I was wondering whether such information is stored in the transaction itself, or if it is possible to get it somehow.

**Tags:** bitcoin-core, transactions, mempool, timestamp, latency


---

## 2 answers

### Answer by username_1 on 2022-12-08. Score: 3

You can use either `getrawmempool` (for all mempool transactions) or `getmempoolentry` (for individual transactions) to get the exact time a transaction was accepted into your node's mempool:

> `"time"`: xxx, (numeric) local time transaction
> entered pool in seconds since 1 Jan 1970 GMT

You can also listen for the `hashtx` ZeroMQ event and store the time when that event was received. Storing timestamps is something you will need to do anyway, since when the transaction becomes confirmed, Bitcoin Core seems to immediately discard the mempool entry data.

> **Comments:**
> **username_0**: Thank you for your answer. But those solutions imply that transactions to be analyzed are new. If I need to fetch transaction latency for some 2014 transactions, how do I do? Is that possible?  
> **username_1**: No, that's not possible, unless you can find someone who collected this data back in 2014 to give it to you, and you also have no way to make sure this data is correct.  

---

### Answer by username_0 on 2022-12-09. Score: 0

As a useful info for who might be needing such data, I have found out that that using [blockchain.info](https://www.blockchain.com/explorer/api/blockchain_api) APIs, information about latency on newer transactions can be fetched. In fact, if we try to query BTC core node:

```
getrawtransaction "614095eeb59da281af6d49d85a153bfd8ec41acca272289e49bc6bd60b7ac7f6" true

```

we notice that `"time": 1669848740`, equals to `"blocktime"` one. However, if we query blockchain.info APIs, we obtain `"time":1669848666`, giving us a latency of 74 seconds.


---

