Skip to content

Commit e8e21e1

Browse files
committed
test(wallet): comment coinbase maturity conditions in test
1 parent fe3c17e commit e8e21e1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

crates/wallet/tests/wallet.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3875,6 +3875,14 @@ fn test_spend_coinbase() {
38753875
};
38763876
insert_anchor(&mut wallet, txid, anchor);
38773877

3878+
// NOTE: A transaction spending an output coming from the coinbase tx at height h, is eligible
3879+
// to be included in block h + [100 = COINBASE_MATURITY] or higher.
3880+
// Tx elibible to be included in the next block will be accepted in the mempool, used in block
3881+
// templates and relayed on the network.
3882+
// Miners may include such tx in a block when their chaintip is at h + [99 = COINBASE_MATURITY - 1].
3883+
// This means these coins are available for selection at height h + 99.
3884+
//
3885+
// By https://bitcoin.stackexchange.com/a/119017
38783886
let not_yet_mature_time = confirmation_height + COINBASE_MATURITY - 2;
38793887
let maturity_time = confirmation_height + COINBASE_MATURITY - 1;
38803888

0 commit comments

Comments
 (0)