Now, when a pruned block is requested via getblock
the answer is:
0error code: -1
1error message:
2Block not available (pruned data)
Would it make sense to add a possibility to (re)download the block so a pruned node can give a meaningful answer in this case as well?
I can imagine two options on how to implement this:
a) automatic - the block is redownloaded automatically when getblock
on a pruned block is requested
b) manual - new method downloadblock
which will redownload the block and make it available to getblock
again
The size of the LRU cache for (re)downloaded blocks could be controlled via prunecache=X
in bitcoin.conf
or we can decide that the node will use up to e.g. 10% of prune capacity for these older blocks.