multi: rename due to required maxHTLC bit
We rename `ChanUpdateOptionMaxHtlc` to `ChanUpdateRequiredMaxHtlc` as with the latest changes it is now required. Similarly, rename `validateOptionalFields` to `ValidateChannelUpdateFields`, export it to use it in a later commit.
This commit is contained in:
14 files changed
+24
-23
No files matched your search
@@ -13,9 +13,9 @@ import (
|
||||
type ChanUpdateMsgFlags uint8
|
||||
|
||||
const (
|
||||
// ChanUpdateOptionMaxHtlc is a bit that indicates whether the
|
||||
// optional htlc_maximum_msat field is present in this ChannelUpdate.
|
||||
ChanUpdateOptionMaxHtlc ChanUpdateMsgFlags = 1 << iota
|
||||
// ChanUpdateRequiredMaxHtlc is a bit that indicates whether the
|
||||
// required htlc_maximum_msat field is present in this ChannelUpdate.
|
||||
ChanUpdateRequiredMaxHtlc ChanUpdateMsgFlags = 1 << iota
|
||||
)
|
||||
|
||||
// String returns the bitfield flags as a string.
|
||||
@@ -26,7 +26,7 @@ func (c ChanUpdateMsgFlags) String() string {
|
||||
// HasMaxHtlc returns true if the htlc_maximum_msat option bit is set in the
|
||||
// message flags.
|
||||
func (c ChanUpdateMsgFlags) HasMaxHtlc() bool {
|
||||
return c&ChanUpdateOptionMaxHtlc != 0
|
||||
return c&ChanUpdateRequiredMaxHtlc != 0
|
||||
}
|
||||
|
||||
// ChanUpdateChanFlags is a bitfield that signals various options concerning a
|
||||
|
||||
@@ -772,7 +772,7 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
// as being part of the ChannelUpdate, to pass
|
||||
// serialization tests, as it will be ignored if the bit
|
||||
// is not set.
|
||||
if msgFlags&ChanUpdateOptionMaxHtlc == 0 {
|
||||
if msgFlags&ChanUpdateRequiredMaxHtlc == 0 {
|
||||
maxHtlc = 0
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ func newMsgChannelUpdate(t testing.TB, r *rand.Rand) *lnwire.ChannelUpdate {
|
||||
// as being part of the ChannelUpdate, to pass
|
||||
// serialization tests, as it will be ignored if the bit
|
||||
// is not set.
|
||||
if msgFlags&lnwire.ChanUpdateOptionMaxHtlc == 0 {
|
||||
if msgFlags&lnwire.ChanUpdateRequiredMaxHtlc == 0 {
|
||||
maxHtlc = 0
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user