Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
When using Replace-By-Fee (RBF) in combination with wallet rescans, the wallet RPC reports transactions with negative confirmation counts (e.g. -900, -1200), long after the replacing transaction has been confirmed.
These negative confirmation values persist even when:
- the replacement transaction is deeply confirmed
- the original transaction is fully conflicted and no longer in the mempool
- wallet balances and UTXO sets are otherwise correct
The negative value appears to encode “distance since replacement” rather than an actual confirmation count.
Expected behaviour
Once a transaction has been replaced via RBF and the replacement transaction is confirmed, the original transaction should report a stable and documented state.
Specifically:
confirmationsshould not become increasingly negative over time- confirmation values should have a clear and documented semantic meaning
- wallet RPC consumers should not need to infer hidden meanings from confirmation numbers
Steps to reproduce
- Create a wallet on regtest
- Send a transaction with BIP125 replaceable flag enabled
- Trigger a wallet rescan
- Perform a bumpfee (RBF replacement)
- Mine blocks to deeply confirm the replacement transaction
- Query
gettransactionfor the original transaction
Observation: The original transaction reports large negative confirmation counts (e.g. -900, -1200), even though the replacement transaction is confirmed.
- regtest mode
- default wallet settings
- descriptor wallet
- RBF enabled
- wallet rescan invoked via RPC
Relevant log output
See attached JSON excerpts showing:
- negative confirmation values
- walletconflicts
- replaced_by_txid relationships
The following excerpts show a replaced RBF transaction reporting large negative confirmation counts long after its replacement has been deeply confirmed. There is no chain reorg and wallet balances are correct.
The negative confirmation value continues to decrease as new blocks are mined, even though the replacing transaction is already confirmed.
This raises a question about RPC semantics: is confirmations for replaced
transactions intended to represent a negative distance to the replacing
transaction’s confirmation height, and if so, where is this behavior documented?
gettransaction.json gettransaction-replace.txt getbalance.txt
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
v27.0
Operating system and version
Ubuntu 22.04 LTS
Machine specifications
x86_64 system, local regtest environment, SSD storage