@@ -6842,12 +6842,23 @@ func marshalDBEdge(edgeInfo *models.ChannelEdgeInfo,
68426842 return edge
68436843}
68446844
6845+ // marshalPolicyExtraOpaqueData marshals the given tlv data and filters out
6846+ // inbound fee record.
6847+ func marshalPolicyExtraOpaqueData (data []byte ) map [uint64 ][]byte {
6848+ records := marshalExtraOpaqueData (data )
6849+
6850+ // Remove the inbound fee record as we have dedicated fields for it.
6851+ delete (records , uint64 (lnwire .FeeRecordType ))
6852+
6853+ return records
6854+ }
6855+
68456856func marshalDBRoutingPolicy (
68466857 policy * models.ChannelEdgePolicy ) * lnrpc.RoutingPolicy {
68476858
68486859 disabled := policy .ChannelFlags & lnwire .ChanUpdateDisabled != 0
68496860
6850- customRecords := marshalExtraOpaqueData (policy .ExtraOpaqueData )
6861+ customRecords := marshalPolicyExtraOpaqueData (policy .ExtraOpaqueData )
68516862 inboundFee := policy .InboundFee .UnwrapOr (lnwire.Fee {})
68526863
68536864 return & lnrpc.RoutingPolicy {
@@ -7361,7 +7372,7 @@ func marshallTopologyChange(
73617372 channelUpdates := make ([]* lnrpc.ChannelEdgeUpdate , len (topChange .ChannelEdgeUpdates ))
73627373 for i , channelUpdate := range topChange .ChannelEdgeUpdates {
73637374
7364- customRecords := marshalExtraOpaqueData (
7375+ customRecords := marshalPolicyExtraOpaqueData (
73657376 channelUpdate .ExtraOpaqueData ,
73667377 )
73677378 inboundFee := channelUpdate .InboundFee .UnwrapOr (lnwire.Fee {})
@@ -7954,12 +7965,9 @@ func (r *rpcServer) UpdateChannelPolicy(ctx context.Context,
79547965 MinHTLC : minHtlc ,
79557966 }
79567967
7957- rpcsLog .Debugf ("[updatechanpolicy] updating channel policy " +
7958- "base_fee=%v, rate_fixed=%v, time_lock_delta: %v, " +
7959- "min_htlc=%v, max_htlc=%v, targets=%v" ,
7960- req .BaseFeeMsat , feeRateFixed , req .TimeLockDelta ,
7961- minHtlc , maxHtlc ,
7962- spew .Sdump (targetChans ))
7968+ rpcsLog .Debugf ("[updatechanpolicy] updating channel policy, " +
7969+ "targets=%v, req=%v" , lnutils .SpewLogClosure (targetChans ),
7970+ lnutils .SpewLogClosure (req ))
79637971
79647972 // With the scope resolved, we'll now send this to the local channel
79657973 // manager so it can propagate the new policy for our target channel(s).
0 commit comments