Review report

bitcoin/bitcoin: PR #36040

3 suggestions

Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Fee-bump locktime overrides use a process-fatal check

Although no current caller setting m_locktime was found, passing it through the fee-bump interface would terminate the process instead of returning a request error.

Location: src/wallet/feebumper.cpp:323 (head).

Details and suggested fix

new_coin_control copies the caller's CCoinControl, including when interfaces::Wallet::createBumpTransaction forwards it, so a supplied m_locktime reaches this assertion unchanged. Bitcoin Core keeps assertions enabled in production builds. Return Result::INVALID_PARAMETER with an error message when the field is set, using the existing failure path instead of terminating the node or wallet process. Keep rejecting the override: merely deleting the check would let CreateTransactionInternal disable anti-fee-sniping and bypass the new floor.


Link

[suggestion] · Timestamp-locktime originals are missing from bump coverage

The new tests miss the height/timestamp filter, so they would not catch its removal giving timestamp-locktime originals replacement locktime 0 on a fresh tip.

Location: test/functional/wallet_bumpfee.py:912 (head).

Details and suggested fix

The functional original uses height - 100, while the unit tests pass height minima directly to DiscourageFeeSniping. Neither exercises the LOCKTIME_THRESHOLD filter in CreateTransactionInternal. Without that filter, an original timestamp becomes an above-tip minimum, forcing the replacement locktime to 0 while both sanity assertions still pass. Add an original with explicit locktime LOCKTIME_THRESHOLD (500000000, already satisfied on this regtest chain), bump it on a fresh tip, and assert the replacement locktime lies in [height - 99, height]. The existing height-above-100 check makes that assertion exclude zero deterministically. Keep the expectation aligned with the intended treatment of timestamp originals, since this test would codify the current height-only floor.


Link

[suggestion] · Locktime comments overstate the minimum and backdating bounds

The new comments describe a general minimum and a 99-block bound, but the field only controls anti-fee-sniping heights and stale tips can preserve an older locktime.

Location: src/wallet/coincontrol.h:118 (head).

Details and suggested fix

m_minimum_locktime only affects anti-fee-sniping: CreateTransactionInternal discards timestamp values and skips it when an explicit locktime or preset sequence disables that logic. An above-tip height forces locktime 0, so this is not a general minimum. Also, spend.h states the 99-block bound without limiting it to a current tip. On a stale tip the helper now copies minimum_height, unless it exceeds the tip, and the new functional test deliberately expects height - 100. Document the field as a height-only anti-fee-sniping floor with these exceptions, and describe the stale-tip result separately from the current-tip 99-block bound.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.