Remove prevGetBlocksMutex.
This is only ever accessed from one place (blockmanager) which is single threaded.
This commit is contained in:
parent
a41c874837
commit
bc89dedf9a
1 changed files with 2 additions and 6 deletions
8
peer.go
8
peer.go
|
@ -117,9 +117,8 @@ type peer struct {
|
||||||
requestedBlocks map[btcwire.ShaHash]bool // owned by blockmanager.
|
requestedBlocks map[btcwire.ShaHash]bool // owned by blockmanager.
|
||||||
lastBlock int32
|
lastBlock int32
|
||||||
retrycount int64
|
retrycount int64
|
||||||
prevGetBlocksBegin *btcwire.ShaHash
|
prevGetBlocksBegin *btcwire.ShaHash // owned by blockmanager.
|
||||||
prevGetBlocksStop *btcwire.ShaHash
|
prevGetBlocksStop *btcwire.ShaHash // owned by blockmaanger.
|
||||||
prevGetBlockMutex sync.Mutex
|
|
||||||
requestQueue *list.List
|
requestQueue *list.List
|
||||||
invSendQueue *list.List
|
invSendQueue *list.List
|
||||||
continueHash *btcwire.ShaHash
|
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
|
// PushGetBlocksMsg sends a getblocks message for the provided block locator
|
||||||
// and stop hash. It will ignore back-to-back duplicate requests.
|
// and stop hash. It will ignore back-to-back duplicate requests.
|
||||||
func (p *peer) PushGetBlocksMsg(locator btcchain.BlockLocator, stopHash *btcwire.ShaHash) error {
|
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,
|
// Extract the begin hash from the block locator, if one was specified,
|
||||||
// to use for filtering duplicate getblocks requests.
|
// to use for filtering duplicate getblocks requests.
|
||||||
// request.
|
// request.
|
||||||
|
|
Loading…
Reference in a new issue