mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
pay: Also treat nonexistent peer as immediate routing failure.
This commit is contained in:
parent
a57a2dcb86
commit
f21cb57d27
@ -434,6 +434,13 @@ static bool send_payment(struct command *cmd,
|
||||
|
||||
peer = peer_by_id(cmd->ld, &ids[0]);
|
||||
if (!peer) {
|
||||
/* Report routing failure to gossipd */
|
||||
fail = immediate_routing_failure(cmd, cmd->ld,
|
||||
WIRE_UNKNOWN_NEXT_PEER,
|
||||
&route[0].channel_id);
|
||||
report_routing_failure(cmd->ld->log, cmd->ld->gossip, fail);
|
||||
|
||||
/* Report routing failure to user */
|
||||
command_fail(cmd, "No connection to first peer found");
|
||||
return false;
|
||||
}
|
||||
@ -458,7 +465,7 @@ static bool send_payment(struct command *cmd,
|
||||
&route[0].channel_id);
|
||||
report_routing_failure(cmd->ld->log, cmd->ld->gossip, fail);
|
||||
|
||||
/* Repor routing failure to user */
|
||||
/* Report routing failure to user */
|
||||
command_fail(cmd, "First peer not ready: %s",
|
||||
onion_type_name(failcode));
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user