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:
Olaoluwa Osuntokun 2017-10-02 22:09:40 -07:00
parent 30906b1a1a
commit 710c2f5dac
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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