Update some comments and code consistency.

This commit is contained in:
Dave Collins 2013-10-07 17:27:59 -05:00
parent ca5c734e05
commit 4b728df738
2 changed files with 8 additions and 8 deletions

View file

@ -547,12 +547,13 @@ func (b *blockManager) handleNotifyMsg(notification *btcchain.Notification) {
}
}
// NewPeer informs the blockmanager of a newly active peer.
// NewPeer informs the block manager of a newly active peer.
func (b *blockManager) NewPeer(p *peer) {
// Ignore if we are shutting down.
if atomic.LoadInt32(&b.shutdown) != 0 {
return
}
b.msgChan <- &newPeerMsg{peer: p}
}
@ -564,8 +565,7 @@ func (b *blockManager) QueueBlock(block *btcutil.Block, p *peer) {
return
}
bmsg := blockMsg{block: block, peer: p}
b.msgChan <- &bmsg
b.msgChan <- &blockMsg{block: block, peer: p}
}
// QueueInv adds the passed inv message and peer to the block handling queue.
@ -576,8 +576,7 @@ func (b *blockManager) QueueInv(inv *btcwire.MsgInv, p *peer) {
return
}
imsg := invMsg{inv: inv, peer: p}
b.msgChan <- &imsg
b.msgChan <- &invMsg{inv: inv, peer: p}
}
// DonePeer informs the blockmanager that a peer has disconnected.
@ -586,6 +585,7 @@ func (b *blockManager) DonePeer(p *peer) {
if atomic.LoadInt32(&b.shutdown) != 0 {
return
}
b.msgChan <- &donePeerMsg{peer: p}
}

View file

@ -135,8 +135,8 @@ func isDust(txOut *btcwire.TxOut) bool {
// a pay-to-pubkey script with a compressed pubkey, which is not very
// common.
//
// The most common scripts are pay-to-script-hash, and as per the above
// breakdown, the minimum size of a p2sh input script is 148 bytes. So
// The most common scripts are pay-to-pubkey-hash, and as per the above
// breakdown, the minimum size of a p2pkh input script is 148 bytes. So
// that figure is used.
totalSize := txOutSize + 148
@ -145,7 +145,7 @@ func isDust(txOut *btcwire.TxOut) bool {
// minTxRelayFee is in Satoshi/KB (kilobyte, not kibibyte), so
// multiply by 1000 to convert bytes.
//
// Using the typical values for a pay-to-script-hash transaction from
// Using the typical values for a pay-to-pubkey-hash transaction from
// the breakdown above and the default minimum transaction relay fee of
// 10000, this equates to values less than 5460 satoshi being considered
// dust.