<p>Bitcoin Core has a <code>getmempoolentry</code> command. This takes a <code>txid</code> and returns information about that transaction's mempool status. This includes <code>height</code> which is the <code>block height when transaction entered pool</code>.</p>

CC BY-SA 4.0
2020-07-22T06:17:07.327Z
Andrew I was talking about the historical data
Haseeb Saeed
CC BY-SA 4.0
2020-07-22T15:20:58.670Z
@HaseebSaeed You should clarify that in your question. Historical data of this kind is not stored by Bitcoin Core. It isn't relevant or useful to node function so it isn't stored. But you could write a program which records this information for every transaction that enters the mempool. You could use the ZMQ interface to be notified of when a transaction enters the mempool and then use that notification to do `getmempoolentry` and save the information wherever you want.
Ava Chow
CC BY-SA 4.0
2020-07-21T20:22:18.327Z
2020-07-21T20:22:18.327Z
Ava Chow
<p>I'm hosting a Listening Bitcoin Node in Capital of Pakistan. I want to know the Block height when Transaction entered the mempool. Right now I'm using the time from the Json format of the Transaction and Checking the Block height against it. Do you guys think that this method is reliable or I fear that transactions in my mempool have more latency than usual node in Europe. Should use an Api to find the Entry Block Height of the transaction?</p>
<p>Please also suggest an api also?</p>

<bitcoin-core><api><block><full-node><height>
How to know Block height when a transaction entered Mempool?
Haseeb Saeed
# How to know Block height when a transaction entered Mempool?

(Asked by: username_0 on 2020-07-21)

I'm hosting a Listening Bitcoin Node in Capital of Pakistan. I want to know the Block height when Transaction entered the mempool. Right now I'm using the time from the Json format of the Transaction and Checking the Block height against it. Do you guys think that this method is reliable or I fear that transactions in my mempool have more latency than usual node in Europe. Should use an Api to find the Entry Block Height of the transaction?

Please also suggest an api also?

**Tags:** bitcoin-core, api, block, full-node, height


---

## 1 answers

### Answer by username_1 on 2020-07-21. Score: 3 | Accepted answer

Bitcoin Core has a `getmempoolentry` command. This takes a `txid` and returns information about that transaction's mempool status. This includes `height` which is the `block height when transaction entered pool`.

> **Comments:**
> **username_0**: Andrew I was talking about the historical data  
> **username_1**: @HaseebSaeed You should clarify that in your question. Historical data of this kind is not stored by Bitcoin Core. It isn't relevant or useful to node function so it isn't stored. But you could write a program which records this information for every transaction that enters the mempool. You could use the ZMQ interface to be notified of when a transaction enters the mempool and then use that notification to do `getmempoolentry` and save the information wherever you want.  

---

