Merge pull request #1449 from Roasbeef/rescan-bug-fix

rpc: fix rescan bug if client disconnects
This commit is contained in:
Olaoluwa Osuntokun 2019-08-06 17:54:14 -07:00 committed by GitHub
commit 4063feeff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2602,6 +2602,13 @@ func handleRescan(wsc *wsClient, icmd interface{}) (interface{}, error) {
if err != nil {
return nil, err
}
// If the last block is nil, then this means that the client
// disconnected mid-rescan. As a result, we don't need to send
// anything back to them.
if lastBlock == nil {
return nil, nil
}
} else {
rpcsLog.Infof("Skipping rescan as client has no addrs/utxos")