Branch: refs/heads/master
Home: https://github.com/conformal/btcchain
Commit: 1b54badde1b8ef67a3963230ec70a77e7a2c34bc
https://github.com/conformal/btcchain/commit/1b54badde1b8ef67a3963230ec70a77e7a2c34bc
Author: Dave Collins <[email protected]>
Date: 2014-01-17 (Fri, 17 Jan 2014)
Changed paths:
M chain.go
M checkpoints.go
Log Message:
-----------
Improve efficiency of checkpoint tracking.
Previously the code performed a database query for every checkpoint (going
backwards) to find the latest known checkpoint on every block. This was
particularly noticabled near the beginning of the block chain when there
are still several checkpoints that haven't been reached yet.
This commit changes the logic to cache the latest known checkpoint while
keeping track of when it needs to be updated once a new later known
checkpoint has been reached.
While here, also add a log message when a checkpoint has been reached and
verified.