MintcoinCommunity / Mintcoin-Desktop-Wallet

Wallet for MintCoin, a community proof-of-stake crypto-currency, running on Linux, Windows, or macOS
MIT License
46 stars 45 forks source link

CheckSync was following a pointer chain to the last sync point #27

Open pol081 opened 7 years ago

pol081 commented 7 years ago

This sits on top of Pull request #25 and #26

CheckSync was following a pointer chain to the last sync point with every new block so the further you got away from a checkpoint the longer it took. Changed so now when a block is traced back to a sync we save the hash, if the next blocks previous matches that hash we will already know that it can travel back to the sync.

Tested by looking at LoadExternalBlockFile and every 500 blocks printed (total elapsed time/ nloaded) in ms

nLoaded Avg Before Avg #25 Avg #26 Avg this
500 4.98ms 2.54ms 1.80ms 1.77ms
20000 5.96ms 3.38ms 2.79ms 2.59ms
100000 7.97ms 5.26ms 4.75ms 3.76ms