state: INPUT_CONNECTION_LOST

We used to have a hacky close timeout which would immediately fire
when we'd closed because the connection was down.  Far better to have
a specific "connection lost" input, and have it respond like CMD_CLOSE.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-03-24 12:09:44 +10:30
parent b423b33236
commit 994addadce
4 changed files with 58 additions and 14 deletions

View File

@@ -192,7 +192,7 @@ if [ -n "$TIMEOUT_ANCHOR" ]; then
sleep 2
# It should send out commit tx.
lcli1 getpeers | $FGREP -w STATE_CLOSE_WAIT_CLOSE_OURCOMMIT
lcli1 getpeers | $FGREP -w STATE_CLOSE_WAIT_OURCOMMIT
# Generate a block (should include commit tx)
check_tx_spend
@@ -212,7 +212,7 @@ if [ -n "$TIMEOUT_ANCHOR" ]; then
lcli1 dev-mocktime $TIME
sleep 2
lcli1 getpeers | $FGREP -w STATE_CLOSE_WAIT_CLOSE_SPENDOURS
lcli1 getpeers | $FGREP -w STATE_CLOSE_WAIT_SPENDOURS
# Now it should have spent the commit tx.
check_tx_spend