htlcswitch+lnwallet+peer: default max htlc in fwding policy of new chans

In this commit, we set a default max HTLC in the forwarding
policies of newly open channels.

The ForwardingPolicy's MaxHTLC field (added in this commit)
will later be used to decide whether an HTLC satisfies our policy before
forwarding it.

To ensure the ForwardingPolicy's MaxHTLC default matches the max HTLC
advertised in the ChannelUpdate sent out for this channel,  we also add
a MaxPendingAmount() function to the lnwallet.Channel.
This commit is contained in:
Valentine Wallace committed 2019-02-21 18:39:32 -08:00
1 parent cbe0bf6a22
commit 20b3114100
3 files changed
+16 -5

No files matched your search

+6
View File
@@ -6336,3 +6336,9 @@ func (lc *LightningChannel) RemoteCommitHeight() uint64 {
func (lc *LightningChannel) FwdMinHtlc() lnwire.MilliSatoshi {
return lc.localChanCfg.MinHTLC
}
// MaxPendingAmount returns the maximum HTLC value that can be pending at
// any time over this channel.
func (lc *LightningChannel) MaxPendingAmount() lnwire.MilliSatoshi {
return lc.localChanCfg.MaxPendingAmount
}