Skip to content

Commit

Permalink
lightningd: expose ignore_fee_limits field in listpeerchannels.
Browse files Browse the repository at this point in the history
Changelog-Added: JSON-RPC: `listpeerchannels` has a new field `ignore_fee_limits`
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jul 22, 2023
1 parent 472db23 commit 8910529
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 148 deletions.
5 changes: 5 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@
"ListPeerChannels.channels[].funding_outnum": 11,
"ListPeerChannels.channels[].funding_txid": 10,
"ListPeerChannels.channels[].htlcs[]": 52,
"ListPeerChannels.channels[].ignore_fee_limits": 54,
"ListPeerChannels.channels[].in_fulfilled_msat": 47,
"ListPeerChannels.channels[].in_offered_msat": 45,
"ListPeerChannels.channels[].in_payments_fulfilled": 46,
Expand Down Expand Up @@ -3881,6 +3882,10 @@
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].ignore_fee_limits": {
"added": "v23.08",
"deprecated": false
},
"ListPeerChannels.channels[].in_fulfilled_msat": {
"added": "v23.02",
"deprecated": false
Expand Down
1 change: 1 addition & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

292 changes: 146 additions & 146 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ def listpeerchannels_channels2py(m):
"peer_connected": m.peer_connected, # PrimitiveField in generate_composite
"state": str(m.state), # EnumField in generate_composite
"scratch_txid": hexlify(m.scratch_txid), # PrimitiveField in generate_composite
"ignore_fee_limits": m.ignore_fee_limits, # PrimitiveField in generate_composite
"owner": m.owner, # PrimitiveField in generate_composite
"short_channel_id": m.short_channel_id, # PrimitiveField in generate_composite
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
Expand Down
3 changes: 2 additions & 1 deletion doc/lightning-listpeerchannels.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ On success, an object containing **channels** is returned. It is an array of ob
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **ignore\_fee\_limits** (boolean, optional): set if we allow this peer to set fees to anything they want *(added v23.08)*
- **feerate** (object, optional): Feerates for the current tx:
- **perkw** (u32): Feerate per 1000 weight (i.e kSipa)
- **perkb** (u32): Feerate per 1000 virtual bytes
Expand Down Expand Up @@ -194,4 +195,4 @@ Main web site: <https://github.com/ElementsProject/lightning> Lightning
RFC site (BOLT \#9):
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>

[comment]: # ( SHA256STAMP:f5103dae3b20a7d2a4112a368e753f1dd0518a269bd34c2fd17657c9f90596d7)
[comment]: # ( SHA256STAMP:c530e39c9144b5fbef0f6474170865095bd7b4c48e6378fdb7f9a7697b909473)
3 changes: 2 additions & 1 deletion doc/lightning-sql.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ The following tables are currently supported:
- `row` (reference to `peerchannels_channel_type.rowid`, sqltype `INTEGER`)
- `arrindex` (index within array, sqltype `INTEGER`)
- `names` (type `string`, sqltype `TEXT`)
- `ignore_fee_limits` (type `boolean`, sqltype `INTEGER`)
- `feerate_perkw` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)
- `feerate_perkb` (type `u32`, sqltype `INTEGER`, from JSON object `feerate`)
- `owner` (type `string`, sqltype `TEXT`)
Expand Down Expand Up @@ -510,4 +511,4 @@ RESOURCES
---------

Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:68c72c66bdc8b0515c6d5dddd5ffd14aa0342bd00f17a44929177c48c36a213f)
[comment]: # ( SHA256STAMP:4cfeeb2855f92a12d6a52d912a58df7573fc34f1f17a190bba26e46695f54de6)
9 changes: 9 additions & 0 deletions doc/schemas/listpeerchannels.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
}
}
},
"ignore_fee_limits": {
"type": "boolean",
"added": "v23.08",
"description": "set if we allow this peer to set fees to anything they want"
},
"feerate": {
"type": "object",
"description": "Feerates for the current tx",
Expand Down Expand Up @@ -609,6 +614,7 @@
"scratch_txid": {},
"channel_type": {},
"feerate": {},
"ignore_fee_limits": {},
"owner": {},
"short_channel_id": {},
"channel_id": {},
Expand Down Expand Up @@ -699,6 +705,7 @@
"scratch_txid": {},
"channel_type": {},
"feerate": {},
"ignore_fee_limits": {},
"owner": {},
"short_channel_id": {},
"channel_id": {},
Expand Down Expand Up @@ -788,6 +795,7 @@
"scratch_txid": {},
"channel_type": {},
"feerate": {},
"ignore_fee_limits": {},
"owner": {},
"short_channel_id": {},
"channel_id": {},
Expand Down Expand Up @@ -878,6 +886,7 @@
"scratch_txid": {},
"channel_type": {},
"feerate": {},
"ignore_fee_limits": {},
"owner": {},
"alias": {},
"short_channel_id": {},
Expand Down
3 changes: 3 additions & 0 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ static void json_add_channel(struct lightningd *ld,
json_add_node_id(response, "peer_id", &peer->id);
json_add_bool(response, "peer_connected", peer->connected == PEER_CONNECTED);
json_add_channel_type(response, "channel_type", channel->type);
if (channel->ignore_fee_limits) {
json_add_bool(response, "ignore_fee_limits", channel->ignore_fee_limits);
}
}
json_add_string(response, "state", channel_state_name(channel));
if (channel->last_tx && !invalid_last_tx(channel->last_tx)) {
Expand Down
2 changes: 2 additions & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3762,6 +3762,8 @@ def test_sql(node_factory, bitcoind):
'type': 'string'},
{'name': 'scratch_txid',
'type': 'txid'},
{'name': 'ignore_fee_limits',
'type': 'boolean'},
{'name': 'feerate_perkw',
'type': 'u32'},
{'name': 'feerate_perkb',
Expand Down

0 comments on commit 8910529

Please sign in to comment.