Skip to content

Commit

Permalink
connectd: don't log every time a peer disconnects.
Browse files Browse the repository at this point in the history
Great for a few of our tests, but generally spammy.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Sep 28, 2018
1 parent 89bac0d commit 3358437
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ 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)
l1.daemon.wait_for_log("Handed peer, entering loop")
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")
Expand Down
6 changes: 4 additions & 2 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 3358437

Please sign in to comment.