<p>First of all, multiple confirmations does not mean that a transaction or its hash is included in multiple blocks. One confirmation means that a transaction was included in a block. More than one confirmation means that blocks have been mined on top of the block containing the transaction.</p>

<p>So what Bitcoin Core does is it records the hash and height of the block that contains the transaction, subtracts the current main chain height from the block height and then adds one. This counts the number of blocks mined after the block containing the transaction and then counts the block itself. This results in the number of confirmations the transaction has.</p>

CC BY-SA 3.0
2018-04-17T22:07:43.367Z
2018-04-17T22:07:43.367Z
Ava Chow
<p>if a transaction has 10 confirmation, does bitcoin-core check if the txid exists in the last 10 blocks? or its calculated based on transaction block number?</p>

<transactions><block><confirmations>
When we're calling `getrawtransaction` how does Bitcoin-core calc and verify confirmations?
Tailer
# When we're calling `getrawtransaction` how does Bitcoin-core calc and verify confirmations?

(Asked by: username_0 on 2018-04-17)

if a transaction has 10 confirmation, does bitcoin-core check if the txid exists in the last 10 blocks? or its calculated based on transaction block number?

**Tags:** transactions, block, confirmations


---

## 1 answers

### Answer by username_1 on 2018-04-17. Score: 1 | Accepted answer

First of all, multiple confirmations does not mean that a transaction or its hash is included in multiple blocks. One confirmation means that a transaction was included in a block. More than one confirmation means that blocks have been mined on top of the block containing the transaction.

So what Bitcoin Core does is it records the hash and height of the block that contains the transaction, subtracts the current main chain height from the block height and then adds one. This counts the number of blocks mined after the block containing the transaction and then counts the block itself. This results in the number of confirmations the transaction has.


---

