invoice_paid_for_storage overwrites account.storage instead of adding to it #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
tasks.py:83-99handles a settled storage purchase. For an existing account:satsaccumulates,storageis assigned. A user who already bought storage and buys again ends up with only the new amount; the ledger says they paid twice._validate_storage(relay/event_validator.py:96-98) gates writes onaccount.storage + free_storage_bytes_value, so the user's writable quota shrinks after paying for more.Impact: money in, purchased capacity lost. Settlement-path defect.
Fix direction:
account.storage += storage_to_buy. Add a test on the FakeWallet fast loop: buy twice, assert the sum. Note the new-account branch at:88-90is correct.Found during reforge run #1 (sandbox nostrrelay#5).