mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
multi: set the InboundFee on ChannelEdgePolicy
In this commit, we make sure to set the new field wherever appropriate. This will be any place where the ChannelEdgePolicy is constructed other than its disk deserialisation.
This commit is contained in:
@@ -3260,6 +3260,26 @@ func (d *AuthenticatedGossiper) handleChanUpdate(ctx context.Context,
|
||||
ExtraOpaqueData: upd.ExtraOpaqueData,
|
||||
}
|
||||
|
||||
// Extract the inbound fee from the ExtraOpaqueData, if present.
|
||||
//
|
||||
// TODO(elle): this can be removed once we define the optional TLV
|
||||
// field on the lnwire.ChannelUpdate itself.
|
||||
var inboundFee lnwire.Fee
|
||||
typeMap, err := upd.ExtraOpaqueData.ExtractRecords(&inboundFee)
|
||||
if err != nil {
|
||||
rErr := fmt.Errorf("%w: %w", graphdb.ErrParsingExtraTLVBytes,
|
||||
err)
|
||||
|
||||
log.Error(rErr)
|
||||
nMsg.err <- rErr
|
||||
return nil, false
|
||||
}
|
||||
|
||||
val, ok := typeMap[lnwire.FeeRecordType]
|
||||
if ok && val == nil {
|
||||
update.InboundFee = fn.Some(inboundFee)
|
||||
}
|
||||
|
||||
if err := d.cfg.Graph.UpdateEdge(update, ops...); err != nil {
|
||||
if graph.IsError(
|
||||
err, graph.ErrOutdated,
|
||||
|
Reference in New Issue
Block a user