mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 09:50:08 +01:00
Cleanup a few comments.
This commit is contained in:
parent
39e7e5c4a1
commit
8be23c89ae
@ -23,7 +23,8 @@ func (b *BlockChain) maybeAcceptBlock(block *btcutil.Block) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// The height of this block one more than the referenced previous block.
|
||||
// The height of this block is one more than the referenced previous
|
||||
// block.
|
||||
blockHeight := int64(0)
|
||||
if prevNode != nil {
|
||||
blockHeight = prevNode.height + 1
|
||||
|
@ -38,8 +38,8 @@ func (b *BlockChain) BlockLocatorFromHash(hash *btcwire.ShaHash) BlockLocator {
|
||||
}
|
||||
|
||||
// Attempt to find the height of the block that corresponds to the
|
||||
// passed hash, and if it's on a side chain, find the height at which
|
||||
// it forks from the main chain.
|
||||
// passed hash, and if it's on a side chain, also find the height at
|
||||
// which it forks from the main chain.
|
||||
blockHeight := int64(-1)
|
||||
forkHeight := int64(-1)
|
||||
node, exists := b.index[*hash]
|
||||
|
6
chain.go
6
chain.go
@ -758,8 +758,8 @@ func (b *BlockChain) disconnectBlock(node *blockNode, block *btcutil.Block) erro
|
||||
// This node's parent is now the end of the best chain.
|
||||
b.bestChain = node.parent
|
||||
|
||||
// Notify the caller that the block was disconnect from the main chain.
|
||||
// The caller would typically want to react with actions such as
|
||||
// Notify the caller that the block was disconnected from the main
|
||||
// chain. The caller would typically want to react with actions such as
|
||||
// updating wallets.
|
||||
b.sendNotification(NTBlockDisconnected, block)
|
||||
|
||||
@ -789,7 +789,7 @@ func (b *BlockChain) reorganizeChain(detachNodes, attachNodes *list.List) error
|
||||
//
|
||||
// NOTE: bitcoind does these checks directly when it connects a block.
|
||||
// The downside to that approach is that if any of these checks fail
|
||||
// after disconneting some blocks or attaching others, all of the
|
||||
// after disconnecting some blocks or attaching others, all of the
|
||||
// operations have to be rolled back to get the chain back into the
|
||||
// state it was before the rule violation (or other failure). There are
|
||||
// at least a couple of ways accomplish that rollback, but both involve
|
||||
|
@ -790,7 +790,7 @@ func (b *BlockChain) checkConnectBlock(node *blockNode, block *btcutil.Block) er
|
||||
}
|
||||
|
||||
// Check for overflow or going over the limits. We have to do
|
||||
// this on every loop to avoid overflow.
|
||||
// this on every loop iteration to avoid overflow.
|
||||
lastSigops := totalSigOps
|
||||
totalSigOps += numsigOps
|
||||
if totalSigOps < lastSigops || totalSigOps > maxSigOpsPerBlock {
|
||||
|
Loading…
Reference in New Issue
Block a user