fix nil dereference bug for state syncing (#332)

pull/351/head^2
chaosma 6 years ago committed by GitHub
parent 416ea172b0
commit ed25ebdd18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      node/node.go

@ -600,7 +600,7 @@ func (node *Node) SendNewBlockToUnsync() {
continue
}
response := config.client.PushNewBlock(selfPeerID, blockHash, false)
if response.Type == downloader_pb.DownloaderResponse_INSYNC {
if response != nil && response.Type == downloader_pb.DownloaderResponse_INSYNC {
node.stateMutex.Lock()
node.peerRegistrationRecord[peerID].client.Close()
delete(node.peerRegistrationRecord, peerID)

Loading…
Cancel
Save