From 32fbae71883cea149c5d34f746daa3cbfcbee273 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Nov 2017 18:04:52 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_bitcoin.c | 21 ++++++++++----------- iguana/exchanges/LP_transaction.c | 10 +++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 26dfd22f6..4f9d60859 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2347,7 +2347,6 @@ int32_t bitcoin_scriptget(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint32_ *userdatap = 0; *userdatalenp = *pubkeysizep = *sigsizep = 0; *hashtypep = SIGHASH_ALL; - printf("siglen.%d\n",scriptsig[0]); while ( (siglen= scriptsig[n]) >= 70 && siglen <= 73 && n+siglen < len && j < 16 ) { vp->signers[j].siglen = siglen; @@ -2356,11 +2355,11 @@ int32_t bitcoin_scriptget(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint32_ *hashtypep = vp->signers[j].sig[siglen-1]; else if ( vp->signers[j].sig[siglen-1] != (*hashtypep & (~SIGHASH_FORKID)) ) { - printf("SIGHASH.%d mismatch %d vs %d\n",j,vp->signers[j].sig[siglen-1],*hashtypep); + //printf("SIGHASH.%d mismatch %d vs %d\n",j,vp->signers[j].sig[siglen-1],*hashtypep); break; } (*sigsizep) += siglen; - printf("sigsize %d [%02x]\n",*sigsizep,vp->signers[j].sig[siglen-1]); + //printf("sigsize %d [%02x]\n",*sigsizep,vp->signers[j].sig[siglen-1]); n += (siglen + 1); j++; if ( spendtype == 0 && j > 1 ) @@ -3295,9 +3294,9 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i { dest.vins[i].vinscript = spendscript; dest.vins[i].scriptlen = spendlen; - int32_t j; for (j=0; j 0 ) // (dest.tx_in != 1 || bits256_nonz(dest.vins[0].prev_hash) != 0) && dest.vins[0].scriptlen > 0 && { #ifdef BTC2_VERSION @@ -3323,7 +3322,7 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i revsigtxid = bits256_doublesha256(0,serialized,len); for (i=0; itx_in; i++) { - printf("vin.%d starts offset.%d numvins.%d\n",i,len,msg->tx_in); + //printf("vin.%d starts offset.%d numvins.%d\n",i,len,msg->tx_in); if ( vins != 0 && jitem(vins,i) != 0 ) iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); if ( (n= iguana_vinparse(rwflag,&serialized[len],&msg->vins[i])) < 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3408a701d..f75c0b935 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -402,7 +402,7 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, vpnstr[0] = 0; *signedtx = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); - printf("bitcoin_verifyvins numvins.%d numvouts.%d\n",msgtx->tx_in,numvouts); + //printf("bitcoin_verifyvins numvins.%d numvouts.%d\n",msgtx->tx_in,numvouts); for (vini=0; vinitx_in; vini++) { if ( V->p2shscript[0] != 0 && V->p2shlen != 0 ) @@ -420,9 +420,9 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, } if ( zcash == LP_IS_BITCOINCASH ) sighash |= SIGHASH_FORKID; - printf("bitcoin_verifyvins scriptlen.%d siglen.%d\n",scriptlen,V[vini].signers[0].siglen); + //printf("bitcoin_verifyvins scriptlen.%d siglen.%d\n",scriptlen,V[vini].signers[0].siglen); sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,serialized,maxlen,msgtx,vini,script,scriptlen,sighash,vpnstr,suppress_pubkeys,zcash); - printf("bitcoin_verifyvins scriptlen.%d siglen.%d\n",scriptlen,V[vini].signers[0].siglen); + //printf("bitcoin_verifyvins scriptlen.%d siglen.%d\n",scriptlen,V[vini].signers[0].siglen); if ( bits256_nonz(sigtxid) != 0 ) { vp = &V[vini]; @@ -462,14 +462,14 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype, { flag++; numsigs++; - int32_t z; char tmpaddr[64]; + /*int32_t z; char tmpaddr[64]; for (z=0; zsigners[j].pubkey[z]); bitcoin_address(tmpaddr,0,0,vp->signers[j].pubkey,33); - printf(" <- pub, SIG.%d.%d VERIFIED numsigs.%d vs M.%d %s\n",vini,j,numsigs,vp->M,tmpaddr); + printf(" <- pub, SIG.%d.%d VERIFIED numsigs.%d vs M.%d %s\n",vini,j,numsigs,vp->M,tmpaddr);*/ } } if ( numsigs >= vp->M )