diff --git a/connectd/connectd.c b/connectd/connectd.c index c71b186e8cbe..c2fb8395977c 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -1111,9 +1111,6 @@ static struct io_plan *peer_disconnected(struct io_conn *conn, io_wake(key); tal_free(key); - status_trace("Forgetting peer %s", - type_to_string(tmpctx, struct pubkey, &id)); - return daemon_conn_read_next(conn, &daemon->master); } diff --git a/tests/test_closing.py b/tests/test_closing.py index 45cb348eac44..5c2c67cb74cd 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -125,8 +125,8 @@ def test_closing_id(node_factory): l1.fund_channel(l2, 10**6) cid = l2.rpc.listpeers()['peers'][0]['channels'][0]['channel_id'] l2.rpc.close(cid) - l1.daemon.wait_for_log("Forgetting peer .*") - l2.daemon.wait_for_log("Forgetting peer .*") + wait_for(lambda: not only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']) + wait_for(lambda: not only_one(l2.rpc.listpeers(l1.info['id'])['peers'])['connected']) # Close by peer ID. l2.rpc.connect(l1.info['id'], 'localhost', l1.port) @@ -134,8 +134,8 @@ def test_closing_id(node_factory): l2.fund_channel(l1, 10**6) pid = l1.info['id'] l2.rpc.close(pid) - l1.daemon.wait_for_log("Forgetting peer .*") - l2.daemon.wait_for_log("Forgetting peer .*") + wait_for(lambda: not only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']) + wait_for(lambda: not only_one(l2.rpc.listpeers(l1.info['id'])['peers'])['connected']) @unittest.skipIf(not DEVELOPER, "needs dev-rescan-outputs") diff --git a/tests/test_connection.py b/tests/test_connection.py index 5c30f8b56c1b..deb4d1a6d93e 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -305,7 +305,7 @@ def test_reconnect_gossiping(node_factory): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l2.rpc.ping(l1.info['id'], 1, 65532) - l1.daemon.wait_for_log('Forgetting peer') + wait_for(lambda: l1.rpc.listpeers(l2.info['id'])['peers'] == []) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l2.daemon.wait_for_log('processing now old peer gone') @@ -1023,7 +1023,9 @@ def test_peerinfo(node_factory, bitcoind): with pytest.raises(RpcError, match=r'Channel close negotiation not finished'): l1.rpc.close(chan, False, 0) - l1.daemon.wait_for_log('Forgetting peer') + wait_for(lambda: not only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']) + wait_for(lambda: not only_one(l2.rpc.listpeers(l1.info['id'])['peers'])['connected']) + bitcoind.generate_block(100) l1.daemon.wait_for_log('WIRE_ONCHAIN_ALL_IRREVOCABLY_RESOLVED') l2.daemon.wait_for_log('WIRE_ONCHAIN_ALL_IRREVOCABLY_RESOLVED')