mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
paymod: Do not reply to the same JSON-RPC command multiple times
This commit is contained in:
@@ -579,8 +579,12 @@ static void payment_finished(struct payment *p)
|
|||||||
assert((result.leafstates & PAYMENT_STEP_SUCCESS) == 0 ||
|
assert((result.leafstates & PAYMENT_STEP_SUCCESS) == 0 ||
|
||||||
result.preimage != NULL);
|
result.preimage != NULL);
|
||||||
|
|
||||||
if (p->parent == NULL) {
|
if (p->parent == NULL && cmd == NULL) {
|
||||||
assert(p->cmd != NULL);
|
/* This is the tree root, but we already reported success or
|
||||||
|
* failure, so noop. */
|
||||||
|
return;
|
||||||
|
|
||||||
|
} else if (p->parent == NULL) {
|
||||||
if (payment_is_success(p)) {
|
if (payment_is_success(p)) {
|
||||||
assert(result.treestates & PAYMENT_STEP_SUCCESS);
|
assert(result.treestates & PAYMENT_STEP_SUCCESS);
|
||||||
assert(result.leafstates & PAYMENT_STEP_SUCCESS);
|
assert(result.leafstates & PAYMENT_STEP_SUCCESS);
|
||||||
|
|||||||
Reference in New Issue
Block a user