multi: thread bandwidth check amount down to MayAddOutgoingHtlc
Pass htlc amount down to the channel so that we don't need to rely on minHtlc (and pad it when the channel sets a 0 min htlc). Update test to just check some sane values since we're no longer relying on minHtlc amount at all.
This commit is contained in:
13 files changed
+81
-39
No files matched your search
+6
-4
@@ -2203,10 +2203,12 @@ func (l *channelLink) Bandwidth() lnwire.MilliSatoshi {
|
||||
return l.channel.AvailableBalance()
|
||||
}
|
||||
|
||||
// MayAddOutgoingHtlc indicates whether we may add any more outgoing htlcs to
|
||||
// this channel.
|
||||
func (l *channelLink) MayAddOutgoingHtlc() error {
|
||||
return l.channel.MayAddOutgoingHtlc()
|
||||
// MayAddOutgoingHtlc indicates whether we can add an outgoing htlc with the
|
||||
// amount provided to the link. This check does not reserve a space, since
|
||||
// forwards or other payments may use the available slot, so it should be
|
||||
// considered best-effort.
|
||||
func (l *channelLink) MayAddOutgoingHtlc(amt lnwire.MilliSatoshi) error {
|
||||
return l.channel.MayAddOutgoingHtlc(amt)
|
||||
}
|
||||
|
||||
// getDustSum is a wrapper method that calls the underlying channel's dust sum
|
||||
|
||||
Reference in new issue
Block a user