@@ -239,8 +239,7 @@ static struct command_result *json_inspect(struct command *cmd,
239239 NULL ))
240240 return command_param_failed ();
241241
242- if (streq (acct_name , WALLET_ACCT )
243- || streq (acct_name , EXTERNAL_ACCT ))
242+ if (!is_channel_account (acct_name ))
244243 return command_fail (cmd , PLUGIN_ERROR ,
245244 "`inspect` not supported for"
246245 " non-channel accounts" );
@@ -298,7 +297,7 @@ static struct command_result *json_inspect(struct command *cmd,
298297 continue ;
299298 } else if (pr -> txo -> acct_db_id != acct -> db_id
300299 /* We make an exception for wallet events */
301- && !streq (pr -> txo -> acct_name , WALLET_ACCT ))
300+ && !is_wallet_account (pr -> txo -> acct_name ))
302301 continue ;
303302 } else if (pr -> spend
304303 && pr -> spend -> acct_db_id != acct -> db_id )
@@ -585,7 +584,7 @@ static struct command_result *json_list_balances(struct command *cmd,
585584
586585 /* Skip the external acct balance, it's effectively
587586 * meaningless */
588- if (streq (accts [i ]-> name , EXTERNAL_ACCT ))
587+ if (is_external_account (accts [i ]-> name ))
589588 continue ;
590589
591590 /* Add it to the result data */
@@ -1009,9 +1008,9 @@ static char *do_account_close_checks(const tal_t *ctx,
10091008 db_begin_transaction (db );
10101009
10111010 /* If is an external acct event, might be close channel related */
1012- if (!is_channel_account (acct ) && e -> origin_acct ) {
1011+ if (!is_channel_account (acct -> name ) && e -> origin_acct ) {
10131012 closed_acct = find_account (ctx , db , e -> origin_acct );
1014- } else if (!is_channel_account (acct ) && !e -> spending_txid )
1013+ } else if (!is_channel_account (acct -> name ) && !e -> spending_txid )
10151014 closed_acct = find_close_account (ctx , db , & e -> outpoint .txid );
10161015 else
10171016 /* Get most up to date account entry */
@@ -1154,7 +1153,7 @@ static struct command_result *json_balance_snapshot(struct command *cmd,
11541153 /* If we're entering a channel account,
11551154 * from a balance entry, we need to
11561155 * go find the channel open info*/
1157- if (!existed && is_channel_account (acct )) {
1156+ if (!existed && is_channel_account (acct -> name )) {
11581157 struct new_account_info * info ;
11591158 u64 timestamp_now ;
11601159
@@ -1630,8 +1629,8 @@ parse_and_log_chain_move(struct command *cmd,
16301629 /* If this is a channel account event, it's possible
16311630 * that we *never* got the open event. (This happens
16321631 * if you add the plugin *after* you've closed the channel) */
1633- if ((!acct -> open_event_db_id && is_channel_account (acct ))
1634- || (orig_acct && is_channel_account (orig_acct )
1632+ if ((!acct -> open_event_db_id && is_channel_account (acct -> name ))
1633+ || (orig_acct && is_channel_account (orig_acct -> name )
16351634 && !orig_acct -> open_event_db_id )) {
16361635 /* Find the channel open info for this peer */
16371636 struct out_req * req ;
@@ -1645,7 +1644,7 @@ parse_and_log_chain_move(struct command *cmd,
16451644 info = tal (cmd , struct event_info );
16461645 info -> ev = tal_steal (info , e );
16471646 info -> acct = tal_steal (info ,
1648- is_channel_account (acct ) ?
1647+ is_channel_account (acct -> name ) ?
16491648 acct : orig_acct );
16501649
16511650 req = jsonrpc_request_start (cmd ,
0 commit comments