From 4b728df738560ecfd5bf3d7fe8b1722011adf18f Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 7 Oct 2013 17:27:59 -0500 Subject: [PATCH] Update some comments and code consistency. --- blockmanager.go | 10 +++++----- mempool.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blockmanager.go b/blockmanager.go index 0d9e8517..f814fbc7 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -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} } diff --git a/mempool.go b/mempool.go index d09a695d..c9d4a98c 100644 --- a/mempool.go +++ b/mempool.go @@ -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.