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

Implement prune_gamedb RPC command. #75

Merged
merged 1 commit into from
Aug 16, 2014

Conversation

domob1812
Copy link
Contributor

Add a first (trivial) "appetizer" for pruning: With this patch, a new RPC command "prune_gamedb" is implemented. This can be used to remove old entries from game.dat to shrinken it. The exact usage is like this:

huntercoind prune_gamedb DEPTH

DEPTH is the number of blocks to keep. At least the current state and one before it will always be kept, though, so it is possible to use 0 as DEPTH.

Pruning of the game state should be possible without any risk. The only consequence is that the game state has to be recalculated (expensive!) when game_getstate is used with an explicit old block number, or a reorganisation is going back beyond the last saved state (unlikely).

Doing prune_gamedb 5000 brings the size of game.dat down from 200 MiB to less than 1 MiB. So it is not entirely pointless, although this pruning is, admittedly, the one with the least potential savings. But it was also the easiest to implement.

chronokings added a commit that referenced this pull request Aug 16, 2014
Implement prune_gamedb RPC command.
@chronokings chronokings merged commit 5536f80 into chronokings:master Aug 16, 2014
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