<p>Every now and then, blocks become orphaned during what is called blockchain reorganization.  This happens when two valid blocks are found at about the same time, and the network is split on which one is considered the top of the blockchain.  These two blocks can contain different sets of transactions, so one block may contain your transaction while the other one doesn't.</p>

<p>This situation will be automatically resolved.  Let's call the two blocks A and B.  Eventually, a new block will be found on top of one of the two competing blocks.  Let's say this new block, C, is found on top of A.  When C is broadcast, any nodes recognizing the B as the tip of the chain will see that more work as been done on the other fork, and will orphan B in favor of A and C.  It will be like B never happened.  If your transaction was confirmed as part of B, it will be like your transaction never happened.</p>

<p>The good news is that it is likely that A and B share a good deal of the same transactions.  Even though you may have been recognizing B instead of A, there's a good chance the transaction will be already confirmed in A when you come around to recognizing it.  If not, it means the transaction will still be in the mempool, and is likely included in C or will be included in a later block.</p>

<p>As you can see, the odds of this happening go down as each new block piles on top of the block containing your transaction.  By the time 5 blocks have been mined on top of the block containing your transaction (thus 6 confirmations) there is no reasonable chance of that block being orphaned.  The transaction is now permanent.</p>

CC BY-SA 3.0
2018-01-25T18:22:26.757Z
2018-01-30T15:52:18.863Z
2018-01-30T15:52:18.863Z
Jestin
<p>I am using <code>bitcoin-cli</code> to do verification of transfer. From the wiki, it mentions that a transaction has a higher confidence in confirmation after 6 blocks deep. However, a block that is put into the blockchain should not to be reverted or removed. </p>

<p>So I want to know what will trigger a confirmed transaction to become invalid and what will actually happen to the blocks and the blockchain?</p>

<p>Especially in <code>bitcoin-cli</code> when I get a block with the target transaction, what will happen if this transaction does not get the final confirmation?</p>

<p>Reference: <a href="https://en.bitcoin.it/wiki/Confirmation" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Confirmation</a></p>

<bitcoin-core><bitcoind><bitcoin-cli>
What does it mean when a confirmed transaction gets reversed?
Calvin Lau
# What does it mean when a confirmed transaction gets reversed?

(Asked by: username_0 on 2018-01-25)

I am using `bitcoin-cli` to do verification of transfer. From the wiki, it mentions that a transaction has a higher confidence in confirmation after 6 blocks deep. However, a block that is put into the blockchain should not to be reverted or removed.

So I want to know what will trigger a confirmed transaction to become invalid and what will actually happen to the blocks and the blockchain?

Especially in `bitcoin-cli` when I get a block with the target transaction, what will happen if this transaction does not get the final confirmation?

Reference: <https://en.bitcoin.it/wiki/Confirmation>

**Tags:** bitcoin-core, bitcoind, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2018-01-25. Score: 2 | Accepted answer

Every now and then, blocks become orphaned during what is called blockchain reorganization. This happens when two valid blocks are found at about the same time, and the network is split on which one is considered the top of the blockchain. These two blocks can contain different sets of transactions, so one block may contain your transaction while the other one doesn't.

This situation will be automatically resolved. Let's call the two blocks A and B. Eventually, a new block will be found on top of one of the two competing blocks. Let's say this new block, C, is found on top of A. When C is broadcast, any nodes recognizing the B as the tip of the chain will see that more work as been done on the other fork, and will orphan B in favor of A and C. It will be like B never happened. If your transaction was confirmed as part of B, it will be like your transaction never happened.

The good news is that it is likely that A and B share a good deal of the same transactions. Even though you may have been recognizing B instead of A, there's a good chance the transaction will be already confirmed in A when you come around to recognizing it. If not, it means the transaction will still be in the mempool, and is likely included in C or will be included in a later block.

As you can see, the odds of this happening go down as each new block piles on top of the block containing your transaction. By the time 5 blocks have been mined on top of the block containing your transaction (thus 6 confirmations) there is no reasonable chance of that block being orphaned. The transaction is now permanent.


---

