Repository navigation
rpc: hide a mempool output another mempool tx spends - #1231
Conversation
gettxout returned a mempool coin before it asked whether another mempool transaction spends that output. The confirmed path already returned null. Fixes #1227.
There was a problem hiding this comment.
0 bugs, 0 suggestions, 0 nits.
Summary
gettxout now returns null on the unconfirmed branch when MempoolHub::spends_outpoint finds a live mempool spender, using the same (Txid, vout) conflict-map lookup the confirmed branch already uses. That map is filled for every input of a live mempool tx, so a child spending a mempool parent is hidden when include_mempool is true; include_mempool false never consults the mempool, and an unconfirmed out is already null. REST getutxos calls gettxout, Electrum listunspent already skipped mempool-spent outs, and scantxoutset / gettxoutsetinfo are unsupported. The journey submits a child that spends parent vout 0, expects null for both include_mempool values, and still requires the unspent child output at confirmations 0. Help text, docs/rpc.md, and the changelog fragments match that coins view.
Disposition: comment
Fixes #1227.
gettxoutreturned a mempool coin before checkingspends_outpoint. A confirmed output spent in the mempool already came back null. The parent-then-child chapter ofrpc_regtest_mature_chain_opsnow pins both.#1191 carries the same
gettxouthunk inside a larger RPC bundle. Drop that commit when rebasing #1191.Local
cargo test -p rbitcoin-rpc --test suite rpc_regtest_mature_chain_opswent red on the new assert, then green.cargo fmt, clippy,cargo deny, and ast-grep passed. Workspacecargo testwas not run on this host.