Browse Source

listchannels: add `htlc_minimum_msat` and `htlc_maximum_msat` fields.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 6 years ago
parent
commit
b48c644e7a
  1. 3
      CHANGELOG.md
  2. 28
      doc/lightning-listchannels.7
  3. 2
      doc/lightning-listchannels.7.txt
  4. 2
      gossipd/gossipd.c
  5. 2
      lightningd/gossip_control.c
  6. 4
      lightningd/gossip_msg.c
  7. 1
      lightningd/gossip_msg.h

3
CHANGELOG.md

@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- JSON API: `listpeers` status now shows how many confirmations until channel is open (#2405) - JSON API: `listpeers` status now shows how many confirmations until channel is open (#2405)
- Config: Adds parameter `min-capacity-sat` to reject tiny channels. - Config: Adds parameter `min-capacity-sat` to reject tiny channels.
- JSON API: `listforwards` now includes the time an HTLC was received and when it was resolved. Both are expressed as UNIX timestamps to facilitate parsing (Issue [#2491](https://github.com/ElementsProject/lightning/issues/2491), PR [#2528](https://github.com/ElementsProject/lightning/pull/2528)) - JSON API: `listforwards` now includes the time an HTLC was received and when it was resolved. Both are expressed as UNIX timestamps to facilitate parsing (Issue [#2491](https://github.com/ElementsProject/lightning/issues/2491), PR [#2528](https://github.com/ElementsProject/lightning/pull/2528))
+- JSON API: new plugin hooks `invoice_payment` for intercepting invoices before they're paid, `openchannel` for intercepting channel opens, and `htlc_accepted` to decide whether to resolve, reject or continue an incoming or forwarded payment.. - JSON API: new plugin hooks `invoice_payment` for intercepting invoices before they're paid, `openchannel` for intercepting channel opens, and `htlc_accepted` to decide whether to resolve, reject or continue an incoming or forwarded payment..
- plugin: the `connected` hook can now send an `error_message` to the rejected peer. - plugin: the `connected` hook can now send an `error_message` to the rejected peer.
- Protocol: we now enforce `option_upfront_shutdown_script` if a peer negotiates it. - Protocol: we now enforce `option_upfront_shutdown_script` if a peer negotiates it.
- JSON API: `listforwards` now includes the local_failed forwards with failcode (Issue [#2435](https://github.com/ElementsProject/lightning/issues/2435), PR [#2524](https://github.com/ElementsProject/lightning/pull/2524)) - JSON API: `listforwards` now includes the local_failed forwards with failcode (Issue [#2435](https://github.com/ElementsProject/lightning/issues/2435), PR [#2524](https://github.com/ElementsProject/lightning/pull/2524))
@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(Issue [#2409](https://github.com/ElementsProject/lightning/issues/2409)) (Issue [#2409](https://github.com/ElementsProject/lightning/issues/2409))
- JSON API: new withdraw methods `txprepare`, `txsend` and `txdiscard`. - JSON API: new withdraw methods `txprepare`, `txsend` and `txdiscard`.
- plugin: the `warning` notification can now detect any `LOG_UNUSUAL`/`LOG_BROKEN` level event. - plugin: the `warning` notification can now detect any `LOG_UNUSUAL`/`LOG_BROKEN` level event.
- JSON API: `listchannels` has new fields `htlc_minimum_msat` and `htlc_maximum_msat`.
### Changed ### Changed

28
doc/lightning-listchannels.7

@ -2,12 +2,12 @@
.\" Title: lightning-listchannels .\" Title: lightning-listchannels
.\" Author: [see the "AUTHOR" section] .\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 02/18/2019 .\" Date: 05/31/2019
.\" Manual: \ \& .\" Manual: \ \&
.\" Source: \ \& .\" Source: \ \&
.\" Language: English .\" Language: English
.\" .\"
.TH "LIGHTNING\-LISTCHANN" "7" "02/18/2019" "\ \&" "\ \&" .TH "LIGHTNING\-LISTCHANN" "7" "05/31/2019" "\ \&" "\ \&"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -206,6 +206,30 @@ message (BOLT #7)\&.
: The number of blocks delay required to wait for on\-chain settlement when unilaterally closing the channel (BOLT #2)\&. : The number of blocks delay required to wait for on\-chain settlement when unilaterally closing the channel (BOLT #2)\&.
.RE .RE
.sp .sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIhtlc_minimum_msat\fR
: The minimum payment which can be send through this channel\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIhtlc_maximum_msat\fR
: The maximum payment which can be send through this channel\&.
.RE
.sp
If \fIshort_channel_id\fR or \fIsource\fR is supplied and no matching channels are found, a "channels" object with an empty list is returned\&. If \fIshort_channel_id\fR or \fIsource\fR is supplied and no matching channels are found, a "channels" object with an empty list is returned\&.
.SH "ERRORS" .SH "ERRORS"
.sp .sp

2
doc/lightning-listchannels.7.txt

@ -59,6 +59,8 @@ HTLC (BOLT #2).
transferred satoshi (BOLT #2). transferred satoshi (BOLT #2).
- 'delay' : The number of blocks delay required to wait for on-chain settlement - 'delay' : The number of blocks delay required to wait for on-chain settlement
when unilaterally closing the channel (BOLT #2). when unilaterally closing the channel (BOLT #2).
- 'htlc_minimum_msat' : The minimum payment which can be send through this channel.
- 'htlc_maximum_msat' : The maximum payment which can be send through this channel.
If 'short_channel_id' or 'source' is supplied and no matching channels If 'short_channel_id' or 'source' is supplied and no matching channels
are found, a "channels" object with an empty list is returned. are found, a "channels" object with an empty list is returned.

2
gossipd/gossipd.c

@ -1948,6 +1948,8 @@ static struct gossip_halfchannel_entry *hc_entry(const tal_t *ctx,
e->base_fee_msat = c->base_fee; e->base_fee_msat = c->base_fee;
e->fee_per_millionth = c->proportional_fee; e->fee_per_millionth = c->proportional_fee;
e->delay = c->delay; e->delay = c->delay;
e->min = c->htlc_minimum;
e->max = c->htlc_maximum;
return e; return e;
} }

2
lightningd/gossip_control.c

@ -389,6 +389,8 @@ static void json_add_halfchan(struct json_stream *response,
json_add_num(response, "base_fee_millisatoshi", he->base_fee_msat); json_add_num(response, "base_fee_millisatoshi", he->base_fee_msat);
json_add_num(response, "fee_per_millionth", he->fee_per_millionth); json_add_num(response, "fee_per_millionth", he->fee_per_millionth);
json_add_num(response, "delay", he->delay); json_add_num(response, "delay", he->delay);
json_add_amount_msat_only(response, "htlc_minimum_msat", he->min);
json_add_amount_msat_only(response, "htlc_maximum_msat", he->max);
json_object_end(response); json_object_end(response);
} }

4
lightningd/gossip_msg.c

@ -105,6 +105,8 @@ static void fromwire_gossip_halfchannel_entry(const u8 **pptr, size_t *max,
entry->delay = fromwire_u32(pptr, max); entry->delay = fromwire_u32(pptr, max);
entry->base_fee_msat = fromwire_u32(pptr, max); entry->base_fee_msat = fromwire_u32(pptr, max);
entry->fee_per_millionth = fromwire_u32(pptr, max); entry->fee_per_millionth = fromwire_u32(pptr, max);
entry->min = fromwire_amount_msat(pptr, max);
entry->max = fromwire_amount_msat(pptr, max);
} }
struct gossip_getchannels_entry * struct gossip_getchannels_entry *
@ -144,6 +146,8 @@ static void towire_gossip_halfchannel_entry(u8 **pptr,
towire_u32(pptr, entry->delay); towire_u32(pptr, entry->delay);
towire_u32(pptr, entry->base_fee_msat); towire_u32(pptr, entry->base_fee_msat);
towire_u32(pptr, entry->fee_per_millionth); towire_u32(pptr, entry->fee_per_millionth);
towire_amount_msat(pptr, entry->min);
towire_amount_msat(pptr, entry->max);
} }
void towire_gossip_getchannels_entry(u8 **pptr, void towire_gossip_getchannels_entry(u8 **pptr,

1
lightningd/gossip_msg.h

@ -27,6 +27,7 @@ struct gossip_halfchannel_entry {
u32 delay; u32 delay;
u32 base_fee_msat; u32 base_fee_msat;
u32 fee_per_millionth; u32 fee_per_millionth;
struct amount_msat min, max;
}; };
struct gossip_getchannels_entry { struct gossip_getchannels_entry {

Loading…
Cancel
Save