daemon: open-code handling of on-chain states.

Once we see an on-chain tx, we ignore the state machine and handle it
as per the onchain.md draft.  This specifies a *resolution* for each
output, and we're done when they're irrevocable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-05-04 16:14:22 +09:30
parent f6b36b9be3
commit f29a6043d2
6 changed files with 572 additions and 40 deletions

View File

@@ -151,6 +151,12 @@ enum state {
STATE_CLOSE_WAIT_STEAL_THEIRCOMMIT_CLOSE_SPENDOURS,
STATE_CLOSE_WAIT_STEAL_THEIRCOMMIT_CLOSE_SPENDOURS_WITH_HTLCS,
/* Four states to represent closing onchain (for getpeers) */
STATE_CLOSE_ONCHAIN_CHEATED,
STATE_CLOSE_ONCHAIN_THEIR_UNILATERAL,
STATE_CLOSE_ONCHAIN_OUR_UNILATERAL,
STATE_CLOSE_ONCHAIN_MUTUAL,
/*
* Where angels fear to tread.
*/