fundingmanager: send error directly in CancelPeerReservations

The error channel should never be nil, and it should always be buffered.
Because of this we can send directly on the channel.
This commit is contained in:
Johan T. Halseth 2018-05-30 12:13:12 +02:00
parent b63ee1a410
commit 7d38e35cdc
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -775,13 +775,7 @@ func (f *fundingManager) CancelPeerReservations(nodePub [33]byte) {
"node=%x: %v", nodePub[:], err)
}
if resCtx.err != nil {
select {
case resCtx.err <- fmt.Errorf("peer disconnected"):
default:
}
}
resCtx.err <- fmt.Errorf("peer disconnected")
delete(nodeReservations, pendingID)
}