mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-30 10:46:41 +00: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
|
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)
|
blockHeight := int64(0)
|
||||||
if prevNode != nil {
|
if prevNode != nil {
|
||||||
blockHeight = prevNode.height + 1
|
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
|
// 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
|
// passed hash, and if it's on a side chain, also find the height at
|
||||||
// it forks from the main chain.
|
// which it forks from the main chain.
|
||||||
blockHeight := int64(-1)
|
blockHeight := int64(-1)
|
||||||
forkHeight := int64(-1)
|
forkHeight := int64(-1)
|
||||||
node, exists := b.index[*hash]
|
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.
|
// This node's parent is now the end of the best chain.
|
||||||
b.bestChain = node.parent
|
b.bestChain = node.parent
|
||||||
|
|
||||||
// Notify the caller that the block was disconnect from the main chain.
|
// Notify the caller that the block was disconnected from the main
|
||||||
// The caller would typically want to react with actions such as
|
// chain. The caller would typically want to react with actions such as
|
||||||
// updating wallets.
|
// updating wallets.
|
||||||
b.sendNotification(NTBlockDisconnected, block)
|
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.
|
// NOTE: bitcoind does these checks directly when it connects a block.
|
||||||
// The downside to that approach is that if any of these checks fail
|
// 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
|
// 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
|
// state it was before the rule violation (or other failure). There are
|
||||||
// at least a couple of ways accomplish that rollback, but both involve
|
// 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
|
// 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
|
lastSigops := totalSigOps
|
||||||
totalSigOps += numsigOps
|
totalSigOps += numsigOps
|
||||||
if totalSigOps < lastSigops || totalSigOps > maxSigOpsPerBlock {
|
if totalSigOps < lastSigops || totalSigOps > maxSigOpsPerBlock {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user