handshake-org / hsd

Handshake Daemon & Full Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spv: heaers-first sync under checkpoints is unecessary

pinheadmz opened this issue · comments

When checkpoints are active, both full and spv nodes sync headers-first up to the last checkpoint, and then go back and request blocks. For full nodes, these blocks are not verified but applied to wallet, UTXO set and urkel tree. For SPV nodes, what we actually get are merkleblocks which are only applied to the wallet. This seems somewhat wasteful since headers-first sync and SPV merkleblock sync are basically the same thing. We can probably sync SPV a bit faster by requesting merkle blocks from the beginning. We can still check that checkpoint blocks are correct but there's no need to downlado 100,000 headers twice from the network