From ade2242d14a29ee817fcfcf1a73ea0286805b440 Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 1 Dec 2021 09:37:23 -0600 Subject: [PATCH] coin_mvts: don't overwrite account names we add in onchaind we assume that every event coming from onchaind is for that channel's account, but now that we sometimes track external + wallet events from onchaind, we should only add the channel account name if there's nothing set there already --- lightningd/onchain_control.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index da24e6c4c..dd9549c0a 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -276,8 +276,10 @@ static void handle_onchain_log_coin_move(struct channel *channel, const u8 *msg) return; } - mvt->account_name = - type_to_string(mvt, struct channel_id, &channel->cid); + /* Any 'ignored' payments get registed to the wallet */ + if (!mvt->account_name) + mvt->account_name = type_to_string(mvt, struct channel_id, + &channel->cid); notify_chain_mvt(channel->peer->ld, mvt); tal_free(mvt); }