discovery/gossiper_test: set ChannelUpdate max htlc

In this commit, we alter the gossiper test's helper method
that creates channel updates to include the max htlc field
in the ChannelUpdates it creates.

Co-authored-by: Johan T. Halseth <johanth@gmail.com>
This commit is contained in:
Valentine Wallace 2019-01-12 18:59:43 +01:00 committed by Johan T. Halseth
parent 7ab8900eb6
commit f316cc6c7e
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -453,15 +453,20 @@ func createUpdateAnnouncement(blockHeight uint32,
var err error var err error
htlcMinMsat := lnwire.MilliSatoshi(prand.Int63())
a := &lnwire.ChannelUpdate{ a := &lnwire.ChannelUpdate{
ShortChannelID: lnwire.ShortChannelID{ ShortChannelID: lnwire.ShortChannelID{
BlockHeight: blockHeight, BlockHeight: blockHeight,
}, },
Timestamp: timestamp, Timestamp: timestamp,
MessageFlags: 0, MessageFlags: lnwire.ChanUpdateOptionMaxHtlc,
ChannelFlags: flags, ChannelFlags: flags,
TimeLockDelta: uint16(prand.Int63()), TimeLockDelta: uint16(prand.Int63()),
HtlcMinimumMsat: lnwire.MilliSatoshi(prand.Int63()), HtlcMinimumMsat: htlcMinMsat,
// Since the max HTLC must be greater than the min HTLC to pass channel
// update validation, set it to double the min htlc.
HtlcMaximumMsat: 2 * htlcMinMsat,
FeeRate: uint32(prand.Int31()), FeeRate: uint32(prand.Int31()),
BaseFee: uint32(prand.Int31()), BaseFee: uint32(prand.Int31()),
} }