|
|
@ -975,12 +975,14 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n) |
|
|
|
instantdex_addevent(s,*n,"BOB_waitfee","feefound","BTCdeptx","BOB_sentdeposit"); |
|
|
|
instantdex_addevent(s,*n,"BOB_waitfee","BTCdeckC","BTCprivs","BOB_waitfee"); |
|
|
|
instantdex_addevent(s,*n,"BOB_waitfee","BTCprivs","poll","BOB_waitfee"); |
|
|
|
instantdex_addevent(s,*n,"BOB_waitfee","poll","poll","BOB_waitfee"); |
|
|
|
|
|
|
|
// [BLOCKING: fee and deposit] Alice waits for fee and then waits for deposit to confirm and sends altpayment
|
|
|
|
s = instantdex_statecreate(s,n,"Alice_waitfee",ALICE_waitfeefunc,0,"BTC_cleanup",0,0); |
|
|
|
instantdex_addevent(s,*n,"Alice_waitfee","feefound","poll","ALICE_waitdeposit"); |
|
|
|
instantdex_addevent(s,*n,"Alice_waitfee","BTCdeckC","BTCprivs","Alice_waitfee"); |
|
|
|
instantdex_addevent(s,*n,"Alice_waitfee","BTCprivs","poll","Alice_waitfee"); |
|
|
|
instantdex_addevent(s,*n,"Alice_waitfee","poll","poll","Alice_waitfee"); |
|
|
|
|
|
|
|
s = instantdex_statecreate(s,n,"ALICE_waitdeposit",ALICE_waitdepositfunc,0,"BTC_cleanup",0,0); |
|
|
|
instantdex_addevent(s,*n,"ALICE_waitdeposit","depfound","BTCalttx","ALICE_sentalt"); |
|
|
@ -989,6 +991,7 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n) |
|
|
|
// [BLOCKING: BTCalttx and altfound] now Bob's turn to make sure altpayment is confirmed and send real payment
|
|
|
|
s = instantdex_statecreate(s,n,"BOB_sentdeposit",BOB_waitBTCalttxfunc,0,"BOB_reclaimed",0,0); |
|
|
|
instantdex_addevent(s,*n,"BOB_sentdeposit","BTCalttx","poll","BOB_altconfirm"); |
|
|
|
instantdex_addevent(s,*n,"BOB_sentdeposit","poll","poll","BOB_sentdeposit"); |
|
|
|
|
|
|
|
s = instantdex_statecreate(s,n,"BOB_altconfirm",BOB_waitaltconfirmfunc,0,"BOB_reclaimed",0,0); |
|
|
|
instantdex_addevent(s,*n,"BOB_altconfirm","altfound","BTCpaytx","BOB_sentpayment"); |
|
|
@ -997,6 +1000,7 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n) |
|
|
|
// [BLOCKING: BTCpaytx] now Alice's turn to make sure payment is confrmed and send in claim or see bob's reclaim and reclaim
|
|
|
|
s = instantdex_statecreate(s,n,"ALICE_sentalt",ALICE_waitBTCpaytxfunc,0,"ALICE_reclaimed",0,0); |
|
|
|
instantdex_addevent(s,*n,"ALICE_sentalt","BTCpaytx","poll","ALICE_waitconfirms"); |
|
|
|
instantdex_addevent(s,*n,"ALICE_sentalt","poll","poll","ALICE_sentalt"); |
|
|
|
|
|
|
|
s = instantdex_statecreate(s,n,"ALICE_waitconfirms",ALICE_waitconfirmsfunc,0,"ALICE_reclaimed",0,0); |
|
|
|
instantdex_addevent(s,*n,"ALICE_waitconfirms","altfound","BTCprivM","ALICE_claimedbtc"); |
|
|
|