xaya / libxayagame

MIT License
21 stars 20 forks source link

Add pruning support for the Storage interface #9

Closed domob1812 closed 6 years ago

domob1812 commented 6 years ago

This extends the Storage interface such that undo data is stored together with the corresponding block height. By doing so, we allow implementations to implement a new PruneUndoData function that removes all undo data up to a given height - which can be used to save space when blocks are confirmed many times and unlikely to be detached again.

This is a first step towards implementing #8 - namely the changes necessary to Storage. It prepares the stage for the next step, namely to actually call PruneUndoData and ReleaseUndoData from the Game class if pruning is enabled and blocks have enough confirmations.