nutshell
nutshell copied to clipboard
fix: increment fees for correct keysets
Fix for Issue #779: Spending fiat ecash increments fees paid for wrong keyset
Description
This PR fixes a bug where fees from spent proofs were being incorrectly attributed to the currently active keyset rather than to the keyset that the proofs belong to. This caused incorrect fee accounting, especially when dealing with multiple currencies (e.g., spending USD proofs would increment fees on the active SAT keyset).
Changes
- Modified the
_invalidate_proofsmethod inledger.pyto:- Group proofs by keyset ID
- Calculate fees for each keyset separately
- Call
bump_keyset_fees_paidfor each keyset with their respective fees
Issue Reference
Fixes #779