When a block is pruned delete_siblings is called to delete its siblings. This calls delete_branch on each of the siblings, which recursively calls delete_children on each of the blocks in the branch.
However, delete_children only deletes the block's children from the CryptoHash -> ChildrenList mapping in the "Block to Children" section of the BlockTree, but it doesn't delete the deleted child block data from the CryptoHash -> Block mapping in the "Blocks" section of the BlockTree.
Proposed fix: delete_children should also delete the block from the "Blocks" section
When a block is pruned
delete_siblings
is called to delete its siblings. This calls delete_branch on each of the siblings, which recursively callsdelete_children
on each of the blocks in the branch.However,
delete_children
only deletes the block's children from theCryptoHash -> ChildrenList
mapping in the "Block to Children" section of theBlockTree
, but it doesn't delete the deleted child block data from theCryptoHash -> Block
mapping in the "Blocks" section of theBlockTree
.Proposed fix:
delete_children
should also delete the block from the "Blocks" section