lightningd: remove almost all other peer2channel / channel2peer shims.

This final sweep only keepl peer2channel within peer_control.c for
the reconnect case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-02-12 20:43:04 +10:30
committed by Christian Decker
parent 0e93fb932a
commit e20fff9340
6 changed files with 153 additions and 157 deletions

View File

@@ -3462,11 +3462,13 @@ class LightningDTests(BaseLightningDTests):
assert len(l1.rpc.listpeers()['peers']) == 1
# This should fail, the funding tx is in the mempool and may confirm
self.assertRaises(ValueError, l1.rpc.dev_forget_channel, l2.info['id'])
self.assertRaisesRegex(ValueError,
"Cowardly refusing to forget channel",
l1.rpc.dev_forget_channel, l2.info['id'])
assert len(l1.rpc.listpeers()['peers']) == 1
# Forcing should work
l1.rpc.dev_forget_channel(l2.info['id'], True)
l1.rpc.dev_forget_channel(l2.info['id'], None, True)
assert len(l1.rpc.listpeers()['peers']) == 0
# And restarting should keep that peer forgotten