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:
1 file changed
+1
-7
+1
-7
@@ -775,13 +775,7 @@ func (f *fundingManager) CancelPeerReservations(nodePub [33]byte) {
|
|||||||
"node=%x: %v", nodePub[:], err)
|
"node=%x: %v", nodePub[:], err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resCtx.err != nil {
|
resCtx.err <- fmt.Errorf("peer disconnected")
|
||||||
select {
|
|
||||||
case resCtx.err <- fmt.Errorf("peer disconnected"):
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete(nodeReservations, pendingID)
|
delete(nodeReservations, pendingID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user