From bc89dedf9a226b22805b8763b7e4f856c747f35f Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Wed, 16 Oct 2013 00:57:57 +0100 Subject: [PATCH] Remove prevGetBlocksMutex. This is only ever accessed from one place (blockmanager) which is single threaded. --- peer.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/peer.go b/peer.go index 4f04c0d3..844b2e1f 100644 --- a/peer.go +++ b/peer.go @@ -117,9 +117,8 @@ type peer struct { requestedBlocks map[btcwire.ShaHash]bool // owned by blockmanager. lastBlock int32 retrycount int64 - prevGetBlocksBegin *btcwire.ShaHash - prevGetBlocksStop *btcwire.ShaHash - prevGetBlockMutex sync.Mutex + prevGetBlocksBegin *btcwire.ShaHash // owned by blockmanager. + prevGetBlocksStop *btcwire.ShaHash // owned by blockmaanger. requestQueue *list.List invSendQueue *list.List continueHash *btcwire.ShaHash @@ -369,9 +368,6 @@ func (p *peer) pushBlockMsg(sha *btcwire.ShaHash) error { // PushGetBlocksMsg sends a getblocks message for the provided block locator // and stop hash. It will ignore back-to-back duplicate requests. func (p *peer) PushGetBlocksMsg(locator btcchain.BlockLocator, stopHash *btcwire.ShaHash) error { - p.prevGetBlockMutex.Lock() - defer p.prevGetBlockMutex.Unlock() - // Extract the begin hash from the block locator, if one was specified, // to use for filtering duplicate getblocks requests. // request.