From b868b43f6619449054a7f4e26d1bcfac9f7ac1e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Oct 2016 10:35:43 -0300 Subject: [PATCH] test --- basilisk/basilisk_bitcoin.c | 2 +- iguana/iguana_interpreter.c | 2 +- iguana/iguana_notary.c | 10 +++++----- iguana/iguana_sign.c | 12 ++++++++---- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index 00b4233d8..460e89780 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -556,7 +556,7 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi spendlen = bitcoin_pubkeyspend(script,0,pubkey33); for (i=0; itxfee + duplicates*coin->txfee/10,addresses,0,0,0,0,"127.0.0.1",0,1); + rawtx = iguana_calcrawtx(myinfo,coin,&vins,txobj,satoshis * duplicates,changeaddr,coin->txfee + duplicates*coin->txfee/5,addresses,0,0,0,0,"127.0.0.1",0,1); //printf("duplicatesTX.(%s)\n",rawtx); if ( signedtxidp != 0 ) { diff --git a/iguana/iguana_interpreter.c b/iguana/iguana_interpreter.c index df4e27f78..4ed277649 100755 --- a/iguana/iguana_interpreter.c +++ b/iguana/iguana_interpreter.c @@ -1300,7 +1300,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip { if ( stacks->stackdepth < op->stackitems ) { - printf("stackdepth.%d needed.%d (%s) at offset.%ld\n",stacks->stackdepth,op->stackitems,str,(long)str-(long)asmstr); + //printf("stackdepth.%d needed.%d (%s) at offset.%ld\n",stacks->stackdepth,op->stackitems,str,(long)str-(long)asmstr); errs++; break; } diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 37b730220..a043b608b 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -544,8 +544,8 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc { for (j=0; j 8 ) incr = sqrt(numnotaries) + 1; else incr = 1; @@ -727,8 +727,8 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info data[j+sizeof(bits256)] = txid.bytes[j]; } data[sizeof(bits256)*2] = vout; - printf("STATE1: %s send %s %s/v%d\n",coin->symbol,bits256_str(str,hashmsg),bits256_str(str2,txid),vout); - basilisk_channelsend(myinfo,srchash,desthash,channel,heightmsg,data,sizeof(data),600); + //printf("STATE1: %s send %s %s/v%d\n",coin->symbol,bits256_str(str,hashmsg),bits256_str(str2,txid),vout); + basilisk_channelsend(myinfo,srchash,desthash,channel,heightmsg,data,sizeof(data),120); } state = 2; } diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 3243d22af..130680a66 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -319,7 +319,11 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin if ( (pubkeystr= jstr(jitem(pubkeysjson,i),0)) != 0 && (plen= (int32_t)strlen(pubkeystr) >> 1) > 0 ) { if ( V != 0 ) + { memcpy(V->signers[i].pubkey,&vin->vinscript[vin->scriptlen],plen); + if ( V->spendlen == 35 && V->spendscript[0] == 33 && V->spendscript[34] == 0xac ) + suppress_pubkeys = 1; + } if ( suppress_pubkeys == 0 ) { printf("addpub.(%s)\n",pubkeystr); @@ -1292,7 +1296,7 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc //printf("interpreter.(%s)\n",jprint(spendscript,0)); if ( (scriptlen= bitcoin_assembler(coin,logarray,script,spendscript,1,nLockTime,&V[vini])) < 0 ) { - printf("bitcoin_assembler error scriptlen.%d\n",scriptlen); + //printf("bitcoin_assembler error scriptlen.%d\n",scriptlen); errs++; } else if ( scriptlen != activescriptlen || memcmp(script,activescript,scriptlen) != 0 ) @@ -1457,12 +1461,12 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf finalized = iguana_vininfo_create(myinfo,coin,serialized2,maxsize,msgtx,vins,numinputs,V); if ( (complete= bitcoin_verifyvins(coin,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys)) > 0 && signedtx != 0 ) { - int32_t tmp; + int32_t tmp; char str[65]; if ( (tmp= iguana_interpreter(coin,0,iguana_lockval(finalized,jint(txobj,"locktime")),V,numinputs)) < 0 ) { - printf("iguana_interpreter %d error.(%s)\n",tmp,signedtx); + //printf("iguana_interpreter %d error.(%s)\n",tmp,signedtx); complete = 0; - } + } else printf("%s signed\n",bits256_str(str,*signedtxidp)); } } }