peer_control: fix double-state transition on reconnect.

We actually don't need to transition if we're reconnecting, and logic
to go to CHANNELD_NORMAL was wrong: we checked that we'd seen funding tx
locked, but not that we'd received a msg from the remote peer.

We need to fix the tests now we no longer double-transition, too.

Fixes: #188
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-07-01 11:11:17 +09:30
parent f9a2f73072
commit c05f63a4db
2 changed files with 6 additions and 11 deletions

View File

@@ -572,10 +572,8 @@ class LightningDTests(BaseLightningDTests):
# Technically, this is async to fundchannel.
l1.daemon.wait_for_log('sendrawtx exit 0')
# Wait for reconnect, then another ->LOCKIN transition.
# Wait for reconnect, awaiting lockin..
l1.daemon.wait_for_log('Peer has reconnected, state CHANNELD_AWAITING_LOCKIN');
l1.daemon.wait_for_log('-> CHANNELD_AWAITING_LOCKIN', 100)
l2.daemon.wait_for_log('-> CHANNELD_AWAITING_LOCKIN', 100)
l1.bitcoin.rpc.generate(6)