htlcswitch: if unable to add half in channel link, properly increment bandwidth
This commit fixes an existing bug, wherein if we failed to account for the fact that if we we’re unable to add an HTLC for any reason other than an overflown commitment transaction, then we wouldn’t properly re-add the available bandwidth of the offending HTLC.
This commit is contained in:
parent
30906b1a1a
commit
710c2f5dac
@ -587,6 +587,10 @@ func (l *channelLink) handleDownStreamPkt(pkt *htlcPacket, isReProcess bool) {
|
||||
isObfuscated,
|
||||
)
|
||||
|
||||
atomic.AddUint64(&l.availableBandwidth, uint64(htlc.Amount))
|
||||
|
||||
// TODO(roasbeef): need to identify if sent
|
||||
// from switch so don't need to obfuscate
|
||||
go l.cfg.Switch.forward(failPkt)
|
||||
log.Infof("Unable to handle downstream add HTLC: %v", err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user