Initial pruning commits the pruning seed at its first checkpoint. If it is interrupted after that point, startup selects incremental pruning and leaves the historical scan unfinished.
Store the last processed transaction hash in the same transaction as each checkpoint. On restart, prune newly matured tip records, continue after the marker, and clear it with the final commit.
Databases interrupted by older binaries have no marker and still require the existing manual prune_blockchain command.
Use the file size to distinguish a clean EOF from an incomplete trailing chunk before resuming an export
Truncate only that incomplete tail and keep malformed chunks or I/O failures non-destructive
estimate_rct_tx_size() and estimate_tx_weight() compute the Bulletproof padded
output count with `while ((1<<log_padded_outputs) < n_outputs)`, shifting a
signed int. For n_outputs > 2^30 this reaches `1 << 31` (signed overflow, UB),
and once the shift count exceeds the int width the value cycles and never
reaches n_outputs, so the loop never terminates. estimate_tx_size_and_weight()
accepts n_outputs up to INT_MAX (only negative is rejected), so a single
wallet-rpc call spins the handling thread forever.
Shift an unsigned 64-bit one and compare in uint64_t at all three shift sites,
and accumulate the estimated size in size_t (cast the per-input and per-output
terms) so the size arithmetic cannot overflow for large counts.
There are duplicate 'amount' headers when using export_transfers all. Column five represents the transaction total while column eleven represents the amount transferred per destination.
Rename the columns without changing their order or values.
(cherry picked from commit 30ab49d5cb5f7d5b089d20919cf4f02b063f2e6b)
get_reserve_proof picks outputs with is_spent(td, true). That only
counts an output spent once its spending tx has confirmed. commit_tx
marks an output spent as soon as the tx goes to the daemon, well before
it confirms. spent_height stays 0 until then. So an output already used
as input to a pending send still passes as unspent here.
A wallet can prove reserve over outputs it already committed to a
pending send. check_reserve_proof reports them unspent, but they are
gone as soon as that send confirms. Reported with a stagenet repro in
#6595.
Switched to is_spent(td, false), which the wallet's default balance
already uses for this reason. Both the zero-balance guard and the
account_minreserve check used to go through balance_all()/balance(),
which fold in change and self-transfer amounts from our own
unconfirmed txs (m_unconfirmed_txs, m_unconfirmed_payments). Those
amounts have no matching row in m_transfers yet, so once an output is
tied up in a pending send, is_spent(td, false) drops it from
selected_transfers while the pending change keeps the balance call
non-zero, and the guard passes over an empty or thinner selection than
it should. Now both guards sum selected_transfers directly, computed
once, so they match exactly what the proof is built over.