Skip to content

Remove wallet tx will still show wrong balance #1708

@skironDotNet

Description

@skironDotNet

Describe the issue

Sending 15k Spark in this example is somehow allowed by the UI, but logs evidently show it's not

2025-11-06 05:06:57 CommitTransaction:
CTransaction(hash=647ffb05b3, ver=3, type=9, vin.size=1, vout.size=2, nLockTime=1197790, vExtraPayload.size=24307)
CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase d3)
CScriptWitness()
CTxOut(nValue=15000.00000000, scriptPubKey=76a9146c4970881067c3446903679d)
CTxOut(nValue=0.00000000, scriptPubKey=d201d0d2d72db0f021d50e74ed017f)
2025-11-06 05:06:57 AddToWallet 647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a new
2025-11-06 05:06:57 AcceptToMemoryPool(), transaction: 647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a
2025-11-06 05:06:57 AcceptToMemoryPoolWorker(), lelantusJoinSplit=0, fTestNet=0
2025-11-06 05:06:57 CheckTransaction nHeight=2147483647, isVerifyDB=0, isCheckWallet=1, txHash=647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a
2025-11-06 05:06:57 CheckTransaction() failed!CMerkleTx::AcceptToMemoryPool, failed to add txn 647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a to dandelion stempool: bad-txns-spend-invalid.
2025-11-06 05:06:57 CommitTransaction(): Transaction cannot be broadcast immediately, bad-txns-spend-invalid

At this point the UI shows pending balance for spark (the change from potential tx) and 0 for incoming transparent, the overall balance is decreased by the amount of 15k

Then trying two commands
removetxmempool 647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a
removetxwallet 647ffb05b32c01370be0a094dcb9259b028278d7fdf361957baea27fc885194a

both are accepted, the transaction list UI still shows the row, but when double click, the window is empty (feels correct since tx has been removed from the wallet). Should still remove the whole row from the UI.
Restarted the QT, and now the tx row is gone but the balance is still showing wrong with Pending on the private balances.

Can fix it only thru wallet file restore from a backup. So we have 2 bugs, ability to "spend" spark more than allowed per tx, and removetxwallet does not revert the calculations of the balances as if they were happen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions