Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Prune spent inputs after some period of time from WalletBackend #708
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.