Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6881740d6d
  1. 3
      iguana/SuperNET_category.c
  2. 22
      iguana/swaps/iguana_BTCswap.c

3
iguana/SuperNET_category.c

@ -264,7 +264,8 @@ char *bitcoin_hexmsg(struct supernet_info *myinfo,struct category_info *cat,void
}
}
}
printf("unhandled bitcoin_hexmsg.(%d) from %s (%s/%s)\n",len,remoteaddr,agent,method);
if ( coin->RELAYNODE != 0 || coin->VALIDATENODE != 0 )
printf("unhandled bitcoin_hexmsg.(%d) from %s (%s/%s)\n",len,remoteaddr,agent,method);
free_json(json);
return(retstr);
}

22
iguana/swaps/iguana_BTCswap.c

@ -994,43 +994,43 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n)
instantdex_addevent(s,*n,"BTC_idle","BTCoffer","poll","BTC_waitdeck"); // send deck + Chose
instantdex_addevent(s,*n,"BTC_waitdeck","gotdeck","havedeck","BTC_gotdeck"); // virt event
//instantdex_addevent(s,*n,"BTC_waitdeck","havedeck","poll","BTC_waitdeck"); // other side gotdeck
//instantdex_addevent(s,*n,"BTC_waitdeck","sentpriv","poll","BTC_waitdeck");
instantdex_addevent(s,*n,"BTC_waitdeck","havedeck","poll","BTC_waitdeck"); // other side gotdeck
instantdex_addevent(s,*n,"BTC_waitdeck","sentpriv","poll","BTC_waitdeck");
instantdex_addevent(s,*n,"BTC_waitdeck","poll","sentpriv","BTC_waitdeck");
// to goto BTC_waitfee, both must have sent/recv deck and Chosen and verified cut and choose
instantdex_addevent(s,*n,"BTC_gotdeck","gotdeck","sentpriv","BTC_waitfee"); // other gotdeck
//instantdex_addevent(s,*n,"BTC_gotdeck","havedeck","poll","BTC_gotdeck");
//instantdex_addevent(s,*n,"BTC_gotdeck","sentpriv","poll","BTC_gotdeck");
instantdex_addevent(s,*n,"BTC_gotdeck","havedeck","poll","BTC_gotdeck");
instantdex_addevent(s,*n,"BTC_gotdeck","sentpriv","poll","BTC_gotdeck");
instantdex_addevent(s,*n,"BTC_gotdeck","poll","sentpriv","BTC_gotdeck");
// [BLOCKING: feefound] Bob waits for fee and sends deposit when it appears, alice skips past
instantdex_addevent(s,*n,"BTC_waitfee","gendep","poll","BTC_gendeposit"); // bob's virt
instantdex_addevent(s,*n,"BTC_waitfee","waitdep","poll","BTC_waitdeposit"); // alice's virt
//instantdex_addevent(s,*n,"BTC_waitfee","sentpriv","poll","BTC_waitfee");
instantdex_addevent(s,*n,"BTC_waitfee","sentpriv","poll","BTC_waitfee");
instantdex_addevent(s,*n,"BTC_waitfee","poll","sentpriv","BTC_waitfee");
instantdex_addevent(s,*n,"BTC_gendeposit","depmade","poll","BTC_waitaltpayment");
//instantdex_addevent(s,*n,"BTC_gendeposit","sentpriv","poll","BTC_gendeposit");
instantdex_addevent(s,*n,"BTC_gendeposit","sentpriv","poll","BTC_gendeposit");
instantdex_addevent(s,*n,"BTC_gendeposit","poll","sentpriv","BTC_gendeposit");
// [BLOCKING: depfound] Alice waits for deposit to confirm and sends altpayment, bob skips
instantdex_addevent(s,*n,"BTC_waitdeposit","depfound","gotdep","BTC_waitpayment"); // alice virt
//instantdex_addevent(s,*n,"BTC_waitdeposit","gotdep","poll","BTC_waitdeposit");
//instantdex_addevent(s,*n,"BTC_waitdeposit","sentpriv","poll","BTC_waitdeposit");
instantdex_addevent(s,*n,"BTC_waitdeposit","gotdep","poll","BTC_waitdeposit");
instantdex_addevent(s,*n,"BTC_waitdeposit","sentpriv","poll","BTC_waitdeposit");
instantdex_addevent(s,*n,"BTC_waitdeposit","poll","sentpriv","BTC_waitdeposit");
// [BLOCKING: altfound] now Bob's turn to make sure altpayment is confirmed and send payment
instantdex_addevent(s,*n,"BTC_waitaltpayment","altfound","gotalt","BTC_waitpayment"); // virt
instantdex_addevent(s,*n,"BTC_waitaltpayment","gotdep","sentpriv","BTC_waitaltpayment");
//instantdex_addevent(s,*n,"BTC_waitaltpayment","gotalt","poll","BTC_waitaltpayment");
//instantdex_addevent(s,*n,"BTC_waitaltpayment","sentpriv","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_waitaltpayment","gotalt","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_waitaltpayment","sentpriv","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_waitaltpayment","poll","sentpriv","BTC_waitaltpayment");
// [BLOCKING: payfound] now Alice's turn to make sure payment is confrmed and send in claim or see bob's reclaim and reclaim
instantdex_addevent(s,*n,"BTC_waitpayment","payfound","gotpaytx","BTC_makeclaim"); // virt
instantdex_addevent(s,*n,"BTC_waitpayment","gotpaytx","poll","BTC_waitpayment");
//instantdex_addevent(s,*n,"BTC_waitpayment","sentpriv","poll","BTC_waitpayment");
instantdex_addevent(s,*n,"BTC_waitpayment","sentpriv","poll","BTC_waitpayment");
instantdex_addevent(s,*n,"BTC_waitpayment","poll","sentpriv","BTC_waitpayment");
// [BLOCKING: privM] Bob waits for privM either from Alice or alt blockchain

Loading…
Cancel
Save