From e644d6f12dc5e2a0432c0282019bcff963471492 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 6 Jul 2016 05:04:33 -0300 Subject: [PATCH] test --- basilisk/basilisk_swap.c | 4 ++-- iguana/iguana_interpreter.c | 2 ++ iguana/iguana_sign.c | 1 + iguana/main.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index b6e4317e1..fa2976db3 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -139,7 +139,7 @@ int32_t basilisk_rawtx_spend(struct supernet_info *myinfo,struct basilisk_swap * jaddi(vins,item); jdelete(txobj,"vin"); jadd(txobj,"vin",vins); - printf("basilisk_rawtx_spend for %s spendscript.%s\n",rawtx->name,hexstr); + printf("basilisk_rawtx_spend for %s spendscript.%s -> %s\n",rawtx->name,hexstr,dest->name); txobj = bitcoin_txoutput(txobj,dest->spendscript,dest->spendlen,dest->amount); if ( (rawtxbytes= bitcoin_json2hex(myinfo,rawtx->coin,&dest->txid,txobj,&V)) != 0 ) { @@ -928,9 +928,9 @@ void basilisk_swaploop(void *_swap) for (i=0; i<32; i++) printf("%02x",swap->pubB1.bytes[i]); printf(" <- pubB1\n"); - swap->bobpayment.spendlen = basilisk_bobscript(swap->bobpayment.spendscript,0,&swap->bobpayment.locktime,&swap->bobpayment.secretstart,swap,0); if ( swap->iambob != 0 ) { + swap->bobpayment.spendlen = basilisk_bobscript(swap->bobpayment.spendscript,0,&swap->bobpayment.locktime,&swap->bobpayment.secretstart,swap,0); swap->bobdeposit.spendlen = basilisk_bobscript(swap->bobdeposit.spendscript,0,&swap->bobdeposit.locktime,&swap->bobdeposit.secretstart,swap,1); basilisk_rawtx_gen("deposit",myinfo,swap,1,&swap->bobdeposit,swap->bobdeposit.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.spendlen,swap->bobdeposit.coin->chain->txfee,1); basilisk_rawtx_gen("payment",myinfo,swap,1,&swap->bobpayment,swap->bobpayment.locktime,swap->bobpayment.spendscript,swap->bobpayment.spendlen,swap->bobpayment.coin->chain->txfee,1); diff --git a/iguana/iguana_interpreter.c b/iguana/iguana_interpreter.c index b1a32177b..f861ce4fe 100755 --- a/iguana/iguana_interpreter.c +++ b/iguana/iguana_interpreter.c @@ -496,6 +496,7 @@ static int32_t iguana_pushdata(struct iguana_interpreter *stacks,int64_t num64,u struct iguana_stackdata Snum; cJSON *item = 0; char tmpstr[2048]; int32_t num = (int32_t)num64; if ( stacks->lastpath[stacks->ifdepth] < 0 ) return(0); + printf("PUSH.(%lld %p %d\n",(long long)num64,numbuf,numlen); if ( stacks->maxstackdepth > 0 ) { /*if ( numbuf != 0 ) @@ -1105,6 +1106,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip break; } HASH_FIND(hh,OPTABLE,str,j,op); + printf("{%s}\n",str); str += j; if ( op != 0 ) { diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 642fdbb2a..5aac07333 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -966,6 +966,7 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc for (vini=0; vinictx,hash2,pubkey,33); printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i); getchar();**/ - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )