test: fix non_witness_utxo check in rpc_psbt.py
What changed, and why it matters
This commit fixes a typo in a single test file. The test was checking for a misspelled key ('not_witness_utxo') that never appears, so the assertion could never fail. The fix changes it to the correct key ('non_witness_utxo'). This is a test-only bug fix with no effect on the actual Bitcoin Core software users run.
No action required. This is a test-only typo fix and does not affect running Bitcoin Core nodes or user funds.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test/functional/rpc_psbt.py, the assertion assert 'not_witness_utxo' not in mining_node.decodepsbt(psbt)['inputs'][0] was checking for a non-existent key due to a typo. The correct PSBT field name is ‘non_witness_utxo’. The typo made the assertion a no-op (always true), weakening the test’s ability to detect a regression. The patch corrects the spelling. No production code is changed.
Changed components
test/functional/rpc_psbt.pyInspect captured patch +1 / −1
### test/functional/rpc_psbt.py
@@ -159,7 +159,7 @@ def test_utxo_conversion(self):
utxos = wonline.listunspent(addresses=[offline_addr])
raw = wonline.createrawtransaction([{"txid":utxos[0]["txid"], "vout":utxos[0]["vout"]}],[{online_addr:0.9999}])
psbt = wonline.walletprocesspsbt(online_node.converttopsbt(raw))["psbt"]
- assert "not_witness_utxo" not in mining_node.decodepsbt(psbt)["inputs"][0]
+ assert "non_witness_utxo" not in mining_node.decodepsbt(psbt)["inputs"][0]
# add non-witness UTXO manually
psbt_new = PSBT.from_base64(psbt)Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.