Skip to content

Commit

Permalink
lightningd: fix funding_locked in channel_opened notification.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Aug 3, 2022
1 parent 071b1bc commit 75c5ba1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lightningd/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void channel_opened_notification_serialize(struct json_stream *stream,
struct node_id *node_id,
struct amount_sat *funding_sat,
struct bitcoin_txid *funding_txid,
bool *funding_locked)
bool funding_locked)
{
json_object_start(stream, "channel_opened");
json_add_node_id(stream, "id", node_id);
Expand All @@ -216,13 +216,13 @@ REGISTER_NOTIFICATION(channel_opened,

void notify_channel_opened(struct lightningd *ld, struct node_id *node_id,
struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid,
bool *funding_locked)
bool funding_locked)
{
void (*serialize)(struct json_stream *,
struct node_id *,
struct amount_sat *,
struct bitcoin_txid *,
bool *) = channel_opened_notification_gen.serialize;
bool) = channel_opened_notification_gen.serialize;

struct jsonrpc_notification *n
= jsonrpc_notification_start(NULL, channel_opened_notification_gen.topic);
Expand Down
2 changes: 1 addition & 1 deletion lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ static void opening_fundee_finished(struct subd *openingd,

/* Tell plugins about the success */
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)
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
Expand Down

0 comments on commit 75c5ba1

Please sign in to comment.