diff --git a/accept.go b/accept.go index 98674eec0..f6b288fcb 100644 --- a/accept.go +++ b/accept.go @@ -91,12 +91,11 @@ func (b *BlockChain) maybeAcceptBlock(block *btcutil.Block, fastAdd bool) error return RuleError(str) } - // Find the latest known good checkpoint and prevent blocks which fork - // the main chain before it. This prevents storage of new, otherwise - // valid, blocks which build off of old blocks that are likely at a - // much easier difficulty and therefore could be used to waste cache and - // disk space. - checkpointBlock, err := b.findLatestKnownCheckpoint() + // Find the previous checkpoint and prevent blocks which fork the main + // chain before it. This prevents storage of new, otherwise valid, + // blocks which build off of old blocks that are likely at a much easier + // difficulty and therefore could be used to waste cache and disk space. + checkpointBlock, err := b.findPreviousCheckpoint() if err != nil { return err } diff --git a/checkpoints.go b/checkpoints.go index c52218cfb..ade891d91 100644 --- a/checkpoints.go +++ b/checkpoints.go @@ -146,11 +146,11 @@ func (b *BlockChain) verifyCheckpoint(height int64, hash *btcwire.ShaHash) bool return true } -// findLatestKnownCheckpoint finds the most recent checkpoint that is already +// findPreviousCheckpoint finds the most recent checkpoint that is already // available in the downloaded portion of the block chain and returns the // associated block. It returns nil if a checkpoint can't be found (this should // really only happen for blocks before the first checkpoint). -func (b *BlockChain) findLatestKnownCheckpoint() (*btcutil.Block, error) { +func (b *BlockChain) findPreviousCheckpoint() (*btcutil.Block, error) { if b.noCheckpoints || b.checkpointData() == nil { return nil, nil } diff --git a/process.go b/process.go index 281a36c06..a9d26a8ca 100644 --- a/process.go +++ b/process.go @@ -117,14 +117,14 @@ func (b *BlockChain) ProcessBlock(block *btcutil.Block, fastAdd bool) error { return err } - // Find the latest known checkpoint and perform some additional checks - // based on the checkpoint. This provides a few nice properties such as + // Find the previous checkpoint and perform some additional checks based + // on the checkpoint. This provides a few nice properties such as // preventing old side chain blocks before the last checkpoint, // rejecting easy to mine, but otherwise bogus, blocks that could be // used to eat memory, and ensuring expected (versus claimed) proof of - // work requirements since the last checkpoint are met. + // work requirements since the previous checkpoint are met. blockHeader := &block.MsgBlock().Header - checkpointBlock, err := b.findLatestKnownCheckpoint() + checkpointBlock, err := b.findPreviousCheckpoint() if err != nil { return err }