Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune spent inputs after some period of time from WalletBackend #708

zpalmtree opened this Issue Jan 28, 2019 · 0 comments


None yet
1 participant
Copy link

zpalmtree commented Jan 28, 2019

Currently we keep all spent inputs forever, so in case the chain forks, we can revert them to unspent (if they are >= forkHeight). However, there's a point at which the chain is no longer going to fork, say 5000 blocks.

Removing old inputs will reduce the file size significantly, and help keep querying speedy.

I do wonder the best way to implement this. There's not really much point checking every block, since it's a waste of cycles to check and remove a couple of inputs each time. Adding a new thread and checking every N minutes wouldn't hurt.

I think the best way to do it would be to check every N blocks. To keep it simple, probably do it on the same thread as the findTransactionsInBlocks function.

This should be pretty easy to implement for someone who wants a relatively easy task to complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.