mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
libplugin-pay: fix valgrind error
for the case rpc "listpeers" returns an error, such as in shutdown
This commit is contained in:
committed by
Rusty Russell
parent
aae5e7822f
commit
e08528b7b5
@@ -3231,7 +3231,7 @@ static struct command_result *direct_pay_listpeers(struct command *cmd,
|
|||||||
json_to_listpeers_result(tmpctx, buffer, toks);
|
json_to_listpeers_result(tmpctx, buffer, toks);
|
||||||
struct direct_pay_data *d = payment_mod_directpay_get_data(p);
|
struct direct_pay_data *d = payment_mod_directpay_get_data(p);
|
||||||
|
|
||||||
if (tal_count(r->peers) == 1) {
|
if (r && tal_count(r->peers) == 1) {
|
||||||
struct listpeers_peer *peer = r->peers[0];
|
struct listpeers_peer *peer = r->peers[0];
|
||||||
if (!peer->connected)
|
if (!peer->connected)
|
||||||
goto cont;
|
goto cont;
|
||||||
|
|||||||
Reference in New Issue
Block a user