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

fix: remove negative fee assert from get_tx_fee_warning

Public commit record

What the developer wrote

Authored by f321x

97/100 · Strong
fix: remove negative fee assert from get_tx_fee_warning

rm the `assert fee >= 0, f"{fee=!r} must be non-negative satoshis"`
from `Abstract_Wallet.get_tx_fee_warning()` to prevent an exception when
users load a psbt with negative tx fee.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit removes a hard crash (assertion) in Electrum's wallet code when a user loads a partially-signed Bitcoin transaction (PSBT) whose calculated fee is negative. Instead of crashing, Electrum now logs a warning and continues. A negative fee can happen if transaction inputs and outputs are crafted or edited in unusual ways. The change prevents a denial-of-service-like crash when opening such a transaction, but it does not by itself fix whatever produced the negative fee.

Recommended action

Treat as a minor hardening/DoS-mitigation patch. Review whether downstream fee-ratio warnings behave safely with negative values, and consider validating PSBT fees earlier in the import flow. No urgent security response is indicated by the diff alone.

Security signals we found

01

assertion replaced with warning log

02

negative transaction fee handling

03

PSBT loading robustness

04

potential denial-of-service via crafted transaction file

Risk score

Why this scored 37/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/10
Evidence quality 3/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.