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:
4 files changed
+47
-7
No files matched your search
@@ -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