Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
rpc: Don't FlushStateToDisk when pruneblockchain(0) #9524
If it doesn't cause an error or corruption, I'd prefer not to add a special case for it. There is no reason for calling it with 0 so if there is a slight performance overhead when that's done, that's too bad.
changed the title from
qa/rpc: Fix pruneblockchain edge cases
rpc: Don't FlushStatToDisk when pruneblockchain(0)
Jan 27, 2017
It seems that in that case there will also be automatic problems. On IRC yesterday there was a discussion about this, and there are more paths through which it will get into
I wrongly assumed that
For 0.15 or later it would be nice to refactor the pruning code.
Ok, I still stand by what I said above, the code in question should be refactored as there are various paths where this could theoretically go wrong, catching this at the RPC call site will only solve one entry point, and for the right might hide eventual problems further.
E.g. let's say we added a test that calls pruneblockchain(0) and verifies that it does nothing would no longer test anything useful.