You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
multi: make updatechanpolicy fields optional with *_specified flags
This commit makes the base_fee_msat, fee_rate/fee_rate_ppm, and
time_lock_delta fields optional in the UpdateChannelPolicy RPC,
following the existing pattern used by min_htlc_msat_specified.
Previously, these fields were required on every invocation, even when
users only wanted to update a single field. This was a common pain
point reported in issue #1523.
Protocol changes (lnrpc/lightning.proto):
- Add base_fee_msat_specified (field 12)
- Add fee_rate_specified (field 13)
- Add time_lock_delta_specified (field 14)
Internal API changes (routing/router.go):
- FeeSchema.BaseFee: changed from value to pointer (*lnwire.MilliSatoshi)
- FeeSchema.FeeRate: changed from value to pointer (*uint32)
- ChannelPolicy.TimeLockDelta: changed from value to pointer (*uint32)
RPC server changes (rpcserver.go):
- Only validate and apply fields when their *_specified flag is true
- When a field is not specified, the existing channel value is retained
CLI changes (cmd/commands/commands.go):
- Fields are now truly optional (no "argument missing" errors)
- ctx.IsSet() determines whether to set *_specified flags
- Default values shown in help text from chainreg constants
- Help text updated to say "If unset, existing value is retained"
Local channel manager changes (routing/localchans/manager.go):
- updateEdge() only updates fields when pointers are non-nil
- Follows the same pattern already used for MinHTLC
This enables users to update individual policy fields independently:
lncli updatechanpolicy --base_fee_msat 1000 --chan_point abc:0
Without needing to specify all other fields.
NOTE: Proto regeneration required (make rpc).
Fixes#1523
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments