AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 40 Bitcoin

psbt: return an error if fetching input_amount when not present

Public commit record

What the developer wrote

Authored by Jon Griffiths

73/100 · Adequate
psbt: return an error if fetching input_amount when not present

Add has_input_amount to allow callers to determine field presence in the
same way as output_amount.

Also remove non-existent input_value accessors from the SWIG Java
wrapper.

Note this is an ABI change.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes a library function so that it now returns an error when a PSBT/PSET input amount is missing, instead of silently returning zero. It also adds a new 'has_input_amount' check so callers can ask whether the value exists before reading it. The change is an intentional fix to prevent callers from accidentally treating a missing amount as zero. It also cleans up some old, non-existent function names in the Java wrapper.

Recommended action

Treat this as a hardening/behavior-correction patch. Downstream projects using wally_psbt_get_input_amount() should update to check the return code or use psbt_has_input_amount() before fetching the value, because the getter now fails when the amount is absent. Review any code that assumed zero meant 'missing'.

Security signals we found

01

API behavior change: missing field now returns error instead of default zero

02

Adds presence-check accessor to prevent callers from reading unset values

03

ABI break noted by vendor

04

Pattern matches existing output_amount safety design

05

No explicit CVE or security advisory referenced in commit

Risk score

Why this scored 40/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 6/15
Affected reach 8/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.