Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions protocol/blockfetch/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (c *Client) GetBlockRange(start common.Point, end common.Point) error {
"role", "client",
"connection_id", c.callbackContext.ConnectionId.String(),
)
// NOTE: this will be unlocked on BatchDone
c.busyMutex.Lock()
c.blockUseCallback = true
msg := NewMsgRequestRange(start, end)
Expand All @@ -136,6 +137,7 @@ func (c *Client) GetBlockRange(start common.Point, end common.Point) error {
}
err, ok := <-c.startBatchResultChan
if !ok {
c.busyMutex.Unlock()
return protocol.ProtocolShuttingDownError
}
if err != nil {
Expand All @@ -155,6 +157,7 @@ func (c *Client) GetBlock(point common.Point) (ledger.Block, error) {
"role", "client",
"connection_id", c.callbackContext.ConnectionId.String(),
)
// NOTE: this will be unlocked on BatchDone
c.busyMutex.Lock()
c.blockUseCallback = false
msg := NewMsgRequestRange(point, point)
Expand Down