htlcswitch: account for channel reserve in Bandwidth

This commit is contained in:
nsa authored and Johan T. Halseth committed 2018-02-08 18:35:23 -05:00
1 parent 7e7516137d
commit 7e84892c21
2 files changed
+22 -9

No files matched your search

+2 -1
View File
@@ -1264,8 +1264,9 @@ func (l *channelLink) Bandwidth() lnwire.MilliSatoshi {
// TODO(roasbeef): subtract reserve
channelBandwidth := l.channel.AvailableBalance()
overflowBandwidth := l.overflowQueue.TotalHtlcAmount()
reserve := lnwire.NewMSatFromSatoshis(l.channel.GetReserve())
return channelBandwidth - overflowBandwidth
return channelBandwidth - overflowBandwidth - reserve
}
// policyUpdate is a message sent to a channel link when an outside sub-system