<p>I don't believe this is exposed via the JSON-RPC API.</p>

<p>The easiest method would likely be to have a program monitoring <code>debug.log</code> and look for the best height update messages - they will be a few milliseconds off, since I believe those are only logged after block validation has succeeded, but it is likely the closest you can get to a per-node block receipt time, at least without monitoring the network traffic.</p>

CC BY-SA 4.0
2020-05-28T06:53:18.527Z
Thanks. In that last line you mention "without monitoring the network traffic". It would be great if you could elaborate on how to determine the timestamps when a block is received by monitoring the network traffic.
Dragonboy
CC BY-SA 4.0
2020-05-28T02:51:22.407Z
2020-05-28T02:51:22.407Z
Raghav Sood
<p>Is there any variable in the bitcoind code that records the timestamp when a block is received for the first time by a particular node? To be more precise, for transactions, transaction information returned by Bitcoind JSON RPC API contains <code>timereceived</code>. Is there similar field for blocks in the API?</p>

<p>There happens to be similar existing questions in stackexchange but none of them has been appropriately answered.</p>

<bitcoin-core><block><timestamp><p2p>
How to get the time when a block is received at a node?
Dragonboy
# How to get the time when a block is received at a node?

(Asked by: username_0 on 2020-05-28)

Is there any variable in the bitcoind code that records the timestamp when a block is received for the first time by a particular node? To be more precise, for transactions, transaction information returned by Bitcoind JSON RPC API contains `timereceived`. Is there similar field for blocks in the API?

There happens to be similar existing questions in stackexchange but none of them has been appropriately answered.

**Tags:** bitcoin-core, block, timestamp, p2p


---

## 1 answers

### Answer by username_1 on 2020-05-28. Score: 1

I don't believe this is exposed via the JSON-RPC API.

The easiest method would likely be to have a program monitoring `debug.log` and look for the best height update messages - they will be a few milliseconds off, since I believe those are only logged after block validation has succeeded, but it is likely the closest you can get to a per-node block receipt time, at least without monitoring the network traffic.

> **Comments:**
> **username_0**: Thanks. In that last line you mention "without monitoring the network traffic". It would be great if you could elaborate on how to determine the timestamps when a block is received by monitoring the network traffic.  

---

