Skip to content

add cleanwallettransactions RPC command#195

Merged
miketout merged 1 commit intomiketout:devfrom
himu007:dev
Mar 20, 2023
Merged

add cleanwallettransactions RPC command#195
miketout merged 1 commit intomiketout:devfrom
himu007:dev

Conversation

@himu007
Copy link
Copy Markdown

@himu007 himu007 commented Mar 20, 2023

This PR adds cleanwallettransactions RPC call to VerusCoin which will work with VerusCoin itself and should work with any PBaaS chains. It makes the wallet operation faster and dramatically reduces response time of certain RPC calls.

The RPC call removes old transactions from wallet.dat until the oldest UTXO. In order to clean past the oldest utxo, you have to spend that utxo or more to get the desired effect.

This does not reduce the size of wallet.dat but it removes the txs and the daemon can write new txs on those empty spaces.

Here's an example output of the RPC call in vrsctest network:

./vrsctest cleanwallettransactions
{
  "total_transactions": 29476,
  "remaining_transactions": 11092,
  "removed_transactions": 18384
}

@miketout please edit as necessary.

@miketout
Copy link
Copy Markdown
Owner

Thanks!
I'm going to pull, and I'll rename it to prunespentwallettransactions, as many people need that history for tax and/or accounting purposes, and I want them to understand that they're explicitly removing all the spent transactions.

@miketout miketout merged commit b740ec2 into miketout:dev Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants