mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
lightningd: fix funding_locked in channel_opened notification.
Previously, "funding_locked" was always "true"! (It's actually been wrong since its introduction in v0.7.3!) Changelog-Fixed: Plugins: `channel_opened` notification `funding_locked` field is now accurate: was always `true`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
498f9b75f2
commit
645b1b505b
4 changed files with 7 additions and 7 deletions
|
@ -1631,7 +1631,7 @@ static void handle_peer_tx_sigs_sent(struct subd *dualopend,
|
||||||
&channel->peer->id,
|
&channel->peer->id,
|
||||||
&channel->funding_sats,
|
&channel->funding_sats,
|
||||||
&channel->funding.txid,
|
&channel->funding.txid,
|
||||||
&channel->remote_funding_locked);
|
channel->remote_funding_locked);
|
||||||
|
|
||||||
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #2
|
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #2
|
||||||
* The receiving node: ...
|
* The receiving node: ...
|
||||||
|
@ -1997,7 +1997,7 @@ static void handle_peer_tx_sigs_msg(struct subd *dualopend,
|
||||||
&channel->peer->id,
|
&channel->peer->id,
|
||||||
&channel->funding_sats,
|
&channel->funding_sats,
|
||||||
&channel->funding.txid,
|
&channel->funding.txid,
|
||||||
&channel->remote_funding_locked);
|
channel->remote_funding_locked);
|
||||||
|
|
||||||
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #2
|
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #2
|
||||||
* The receiving node: ...
|
* The receiving node: ...
|
||||||
|
|
|
@ -201,7 +201,7 @@ static void channel_opened_notification_serialize(struct json_stream *stream,
|
||||||
struct node_id *node_id,
|
struct node_id *node_id,
|
||||||
struct amount_sat *funding_sat,
|
struct amount_sat *funding_sat,
|
||||||
struct bitcoin_txid *funding_txid,
|
struct bitcoin_txid *funding_txid,
|
||||||
bool *funding_locked)
|
bool funding_locked)
|
||||||
{
|
{
|
||||||
json_object_start(stream, "channel_opened");
|
json_object_start(stream, "channel_opened");
|
||||||
json_add_node_id(stream, "id", node_id);
|
json_add_node_id(stream, "id", node_id);
|
||||||
|
@ -216,13 +216,13 @@ REGISTER_NOTIFICATION(channel_opened,
|
||||||
|
|
||||||
void notify_channel_opened(struct lightningd *ld, struct node_id *node_id,
|
void notify_channel_opened(struct lightningd *ld, struct node_id *node_id,
|
||||||
struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid,
|
struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid,
|
||||||
bool *funding_locked)
|
bool funding_locked)
|
||||||
{
|
{
|
||||||
void (*serialize)(struct json_stream *,
|
void (*serialize)(struct json_stream *,
|
||||||
struct node_id *,
|
struct node_id *,
|
||||||
struct amount_sat *,
|
struct amount_sat *,
|
||||||
struct bitcoin_txid *,
|
struct bitcoin_txid *,
|
||||||
bool *) = channel_opened_notification_gen.serialize;
|
bool) = channel_opened_notification_gen.serialize;
|
||||||
|
|
||||||
struct jsonrpc_notification *n
|
struct jsonrpc_notification *n
|
||||||
= jsonrpc_notification_start(NULL, channel_opened_notification_gen.topic);
|
= jsonrpc_notification_start(NULL, channel_opened_notification_gen.topic);
|
||||||
|
|
|
@ -47,7 +47,7 @@ void notify_invoice_creation(struct lightningd *ld, struct amount_msat *amount,
|
||||||
|
|
||||||
void notify_channel_opened(struct lightningd *ld, struct node_id *node_id,
|
void notify_channel_opened(struct lightningd *ld, struct node_id *node_id,
|
||||||
struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid,
|
struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid,
|
||||||
bool *funding_locked);
|
bool funding_locked);
|
||||||
|
|
||||||
void notify_channel_state_changed(struct lightningd *ld,
|
void notify_channel_state_changed(struct lightningd *ld,
|
||||||
struct node_id *peer_id,
|
struct node_id *peer_id,
|
||||||
|
|
|
@ -539,7 +539,7 @@ static void opening_fundee_finished(struct subd *openingd,
|
||||||
|
|
||||||
/* Tell plugins about the success */
|
/* Tell plugins about the success */
|
||||||
notify_channel_opened(ld, &channel->peer->id, &channel->funding_sats,
|
notify_channel_opened(ld, &channel->peer->id, &channel->funding_sats,
|
||||||
&channel->funding.txid, &channel->remote_funding_locked);
|
&channel->funding.txid, channel->remote_funding_locked);
|
||||||
|
|
||||||
if (pbase)
|
if (pbase)
|
||||||
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
|
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
|
||||||
|
|
Loading…
Add table
Reference in a new issue