Fixes and changes resulting from extensive testing on testnet under different scenarios. Most notably, these changes ensure that a node catching up after a long period of being offline will start the PIBD process from the last validated chain height, update the output leaf sets as needed and re-validate the update chain state without having to re-download the entire set.
Add function to check the leaf set against the PIBD-downloaded bitmap and ensure it matches supplied bitmap, this is necessary in order to cover 'catch-up' cases where outputs from an offline txhashset have been spent during the node's downtime.
Call leaf set check function from state sync.
Don't let desegmenter decide it's finished unless it definitely has the corresponding bitmap. This is necessary since the next step is now to update and possibly correct the output leaf sets based on the bitmap.
Correct size calculations to ensure the correct segments are requested during catch up.
Leaf set of rangeproof pmmr now correctly being updated during PIBD process
Fixes and changes resulting from extensive testing on testnet under different scenarios. Most notably, these changes ensure that a node catching up after a long period of being offline will start the PIBD process from the last validated chain height, update the output leaf sets as needed and re-validate the update chain state without having to re-download the entire set.