mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
pytest: fix race in test_pay_direct.
I got a spurious failure because the final node gave a CLTV error and so it decided to use a different channel. It should probably handle this corner case better, but meanwhile make the test robust. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
41be796e0e
commit
cb6a97152e
@ -328,6 +328,7 @@ remote_routing_failure(const tal_t *ctx,
|
|||||||
if (failcode & PERM)
|
if (failcode & PERM)
|
||||||
*pay_errcode = PAY_DESTINATION_PERM_FAIL;
|
*pay_errcode = PAY_DESTINATION_PERM_FAIL;
|
||||||
else
|
else
|
||||||
|
/* FIXME: not right for WIRE_FINAL_EXPIRY_TOO_SOON */
|
||||||
*pay_errcode = PAY_TRY_OTHER_ROUTE;
|
*pay_errcode = PAY_TRY_OTHER_ROUTE;
|
||||||
erring_node = &route_nodes[origin_index];
|
erring_node = &route_nodes[origin_index];
|
||||||
} else {
|
} else {
|
||||||
|
@ -1374,6 +1374,9 @@ def test_pay_direct(node_factory, bitcoind):
|
|||||||
# Let channels lock in.
|
# Let channels lock in.
|
||||||
bitcoind.generate_block(5)
|
bitcoind.generate_block(5)
|
||||||
|
|
||||||
|
# Make l1 sees it, so it doesn't produce bad CLTVs.
|
||||||
|
sync_blockheight(bitcoind, [l1])
|
||||||
|
|
||||||
# Make sure l0 knows the l2->l3 channel.
|
# Make sure l0 knows the l2->l3 channel.
|
||||||
# Without DEVELOPER, channel lockin can take 30 seconds to detect,
|
# Without DEVELOPER, channel lockin can take 30 seconds to detect,
|
||||||
# and gossip 2 minutes to propagate
|
# and gossip 2 minutes to propagate
|
||||||
|
Loading…
Reference in New Issue
Block a user