Skip to content

Incorrect balance when dealing with coinbase UTXOs that will be mature on h + 1 #32098

@luisschwab

Description

@luisschwab

Bitcoin Core is reporting the wrong balance when dealing with coinbase UTXOs that will become mature on the next block.

Scenario:
On regtest, I mine 101 blocks. Since coinbase maturity height is 100 blocks, I have 1 mature UTXO (50 BTC) at height 101. However, at height 102, another coinbase UTXO (50 BTC) will have matured and will be accepted by the mempool as an input to a transaction. Therefore, my spendable balance at height 102 will be 50+50 BTC (2 UTXOs available for selection).

Currently, only a the first coin (50 BTC) is available for selection.

I first discovered this when doing (manual) differential testing between BDK and Bitcoin Core (see bitcoindevkit/bdk#1878).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions