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

CheckBlock was being computed more than once #26

Open pol081 opened 7 years ago

pol081 commented 7 years ago

This sits on top of Pull request #25

CheckBlock takes about 2x the time of GetHash and was being calculated at least twice per block during bootstrap. Changed CheckBlock to only compute on the first call.

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

nLoaded Avg Before Avg After Avg
500 4.98ms 2.54ms 1.80ms
20000 5.96ms 3.38ms 2.79ms
100000 7.97ms 5.26ms 4.75ms