mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-26 16:51:28 +02:00
discovery: update to recent lnwire.ChannelUpdate changes
This commit is contained in:
parent
319afb14f1
commit
1c0712ca03
@ -263,6 +263,12 @@ func (d *AuthenticatedGossiper) ProcessLocalAnnouncement(msg lnwire.Message,
|
|||||||
func (d *AuthenticatedGossiper) networkHandler() {
|
func (d *AuthenticatedGossiper) networkHandler() {
|
||||||
defer d.wg.Done()
|
defer d.wg.Done()
|
||||||
|
|
||||||
|
// TODO(roasbeef): changes for spec compliance
|
||||||
|
// * make into de-duplicated struct
|
||||||
|
// * always send chan ann -> node ann -> chan update
|
||||||
|
// * buffer recv'd node ann until after chan ann that includes is
|
||||||
|
// created
|
||||||
|
// * can use mostly empty struct in db as place holder
|
||||||
var announcementBatch []lnwire.Message
|
var announcementBatch []lnwire.Message
|
||||||
|
|
||||||
// TODO(roasbeef): parametrize the above
|
// TODO(roasbeef): parametrize the above
|
||||||
@ -371,9 +377,9 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
Timestamp: uint32(p.LastUpdate.Unix()),
|
Timestamp: uint32(p.LastUpdate.Unix()),
|
||||||
Flags: p.Flags,
|
Flags: p.Flags,
|
||||||
TimeLockDelta: p.TimeLockDelta,
|
TimeLockDelta: p.TimeLockDelta,
|
||||||
HtlcMinimumMsat: uint32(p.MinHTLC),
|
HtlcMinimumMsat: uint64(p.MinHTLC),
|
||||||
FeeBaseMsat: uint32(p.FeeBaseMSat),
|
BaseFee: uint32(p.FeeBaseMSat),
|
||||||
FeeProportionalMillionths: uint32(p.FeeProportionalMillionths),
|
FeeRate: uint32(p.FeeProportionalMillionths),
|
||||||
}
|
}
|
||||||
selfChans = append(selfChans, c)
|
selfChans = append(selfChans, c)
|
||||||
return nil
|
return nil
|
||||||
@ -621,8 +627,8 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(nMsg *networkMsg) []l
|
|||||||
Flags: msg.Flags,
|
Flags: msg.Flags,
|
||||||
TimeLockDelta: msg.TimeLockDelta,
|
TimeLockDelta: msg.TimeLockDelta,
|
||||||
MinHTLC: btcutil.Amount(msg.HtlcMinimumMsat),
|
MinHTLC: btcutil.Amount(msg.HtlcMinimumMsat),
|
||||||
FeeBaseMSat: btcutil.Amount(msg.FeeBaseMsat),
|
FeeBaseMSat: btcutil.Amount(msg.BaseFee),
|
||||||
FeeProportionalMillionths: btcutil.Amount(msg.FeeProportionalMillionths),
|
FeeProportionalMillionths: btcutil.Amount(msg.FeeRate),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := d.cfg.Router.UpdateEdge(update); err != nil {
|
if err := d.cfg.Router.UpdateEdge(update); err != nil {
|
||||||
|
@ -339,9 +339,9 @@ func createUpdateAnnouncement(blockHeight uint32) (*lnwire.ChannelUpdate, error)
|
|||||||
},
|
},
|
||||||
Timestamp: uint32(prand.Int31()),
|
Timestamp: uint32(prand.Int31()),
|
||||||
TimeLockDelta: uint16(prand.Int63()),
|
TimeLockDelta: uint16(prand.Int63()),
|
||||||
HtlcMinimumMsat: uint32(prand.Int31()),
|
HtlcMinimumMsat: uint64(prand.Int63()),
|
||||||
FeeBaseMsat: uint32(prand.Int31()),
|
FeeRate: uint32(prand.Int31()),
|
||||||
FeeProportionalMillionths: uint32(prand.Int31()),
|
BaseFee: uint32(prand.Int31()),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub := nodeKeyPriv1.PubKey()
|
pub := nodeKeyPriv1.PubKey()
|
||||||
|
@ -49,9 +49,9 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
|||||||
Timestamp: uint32(e1.LastUpdate.Unix()),
|
Timestamp: uint32(e1.LastUpdate.Unix()),
|
||||||
Flags: 0,
|
Flags: 0,
|
||||||
TimeLockDelta: e1.TimeLockDelta,
|
TimeLockDelta: e1.TimeLockDelta,
|
||||||
HtlcMinimumMsat: uint32(e1.MinHTLC),
|
HtlcMinimumMsat: uint64(e1.MinHTLC),
|
||||||
FeeBaseMsat: uint32(e1.FeeBaseMSat),
|
BaseFee: uint32(e1.FeeBaseMSat),
|
||||||
FeeProportionalMillionths: uint32(e1.FeeProportionalMillionths),
|
FeeRate: uint32(e1.FeeProportionalMillionths),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if e2 != nil {
|
if e2 != nil {
|
||||||
@ -61,9 +61,9 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
|||||||
Timestamp: uint32(e2.LastUpdate.Unix()),
|
Timestamp: uint32(e2.LastUpdate.Unix()),
|
||||||
Flags: 1,
|
Flags: 1,
|
||||||
TimeLockDelta: e2.TimeLockDelta,
|
TimeLockDelta: e2.TimeLockDelta,
|
||||||
HtlcMinimumMsat: uint32(e2.MinHTLC),
|
HtlcMinimumMsat: uint64(e2.MinHTLC),
|
||||||
FeeBaseMsat: uint32(e2.FeeBaseMSat),
|
BaseFee: uint32(e2.FeeBaseMSat),
|
||||||
FeeProportionalMillionths: uint32(e2.FeeProportionalMillionths),
|
FeeRate: uint32(e2.FeeProportionalMillionths),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user