Drop the duplicate p2sh branch in _parse_outputs
What changed, and why it matters
This commit removes a duplicated code branch that did the exact same thing twice in a row. The behavior of the program is unchanged; it is a minor cleanup with no security effect.
No action needed; this is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In _parse_outputs(), a standalone if self.policy["type"] == "p2sh": sc = script.p2sh(out.redeem_script) block was removed because an equivalent elif later in the same chain already handled p2sh. Since p2wsh and p2sh-p2wsh conditions do not match for a p2sh policy, execution always fell through to the elif and reassigned the identical script. The commit author verified parser output is byte-for-byte identical across 112 scenarios and the full test suite passes. No functional or security change.
Changed components
src/seedsigner/models/psbt_parser.pyInspect captured patch +0 / −4
### src/seedsigner/models/psbt_parser.py
@@ -172,10 +172,6 @@ def _parse_outputs(self):
# empty script by default
sc = script.Script(b"")
- # if older multisig, just use existing script
- if self.policy["type"] == "p2sh":
- sc = script.p2sh(out.redeem_script)
-
# multisig, we know witness script
if self.policy["type"] == "p2wsh":
sc = script.p2wsh(out.witness_script)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.