Merge pull request #200 from wpaulino/delete-pending-batch-after-replacement

rpc: delete previous pending batch after receiving replacement
This commit is contained in:
Olaoluwa Osuntokun 2021-01-13 17:09:43 -08:00 committed by GitHub
commit 2ee7d8a74f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,6 +388,16 @@ func (s *rpcServer) handleServerMessage(rpcMsg *poolrpc.ServerAuctionMessage) er
"artifacts: %v", err)
return s.sendRejectBatch(batch, err)
}
// Clear our staging area for the new batch proposal. We
// consider any errors as a hard failure and reject the
// batch.
err = s.server.fundingManager.DeletePendingBatch()
if err != nil {
rpcLog.Errorf("Error clearing previous "+
"pending batch: %v", err)
return s.sendRejectBatch(batch, err)
}
}
// Do an in-depth verification of the batch.