pay: make sure we don't think payment in progress if it immediately fails.

If send_htlc_out() fails, it doesn't initialize pc->out; that can
make us think it's still in progress.

Reported-by: Jonas Nick
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-12-19 10:28:15 +10:30
committed by Christian Decker
parent bd27eba6f8
commit 477a529856
3 changed files with 42 additions and 2 deletions

View File

@@ -252,6 +252,7 @@ static void send_payment(struct command *cmd,
pc->ids = tal_steal(pc, ids);
pc->msatoshi = route[n_hops-1].amount;
pc->path_secrets = tal_steal(pc, path_secrets);
pc->out = NULL;
log_info(cmd->ld->log, "Sending %u over %zu hops to deliver %"PRIu64,
route[0].amount, n_hops, pc->msatoshi);