diff --git a/channeld/channeld.c b/channeld/channeld.c index cc3701eb7..ff9d183af 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -4437,6 +4437,7 @@ static void check_future_dataloss_fields(struct peer *peer, take(towire_channeld_fail_fallen_behind(NULL, remote_current_per_commitment_point))); + sleep(1); /* We have to send them an error to trigger dropping to chain. */ peer_failed_err(peer->pps, &peer->channel_id, "Awaiting unilateral close"); diff --git a/tests/test_connection.py b/tests/test_connection.py index eb9b505f3..cce0c5000 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -3055,9 +3055,8 @@ def test_dataloss_protection(node_factory, bitcoind): assert not l2.daemon.is_in_log('sendrawtx exit 0', start=l2.daemon.logsearch_start) - # l1 should drop to chain, but doesn't always receive ERROR before it sends warning. - # We have to reconnect once - l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + # l1 should receive error and drop to chain + l1.daemon.wait_for_log("They sent ERROR.*Awaiting unilateral close") l1.wait_for_channel_onchain(l2.info['id']) closetxid = only_one(bitcoind.rpc.getrawmempool(False))