|
|
@ -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<spendlen; j++) |
|
|
|
printf("%02x",spendscript[j]); |
|
|
|
printf(" tmpscript.%d vini.%d\n",spendlen,vini); |
|
|
|
//int32_t j; for (j=0; j<spendlen; j++)
|
|
|
|
// printf("%02x",spendscript[j]);
|
|
|
|
//printf(" tmpscript.%d vini.%d\n",spendlen,vini);
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -3310,9 +3309,9 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i |
|
|
|
dest.vins[i].userdatalen = 0; |
|
|
|
} |
|
|
|
len = iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,1,0,serialized,maxlen,&dest,&txid,vpnstr,0,0,0,suppress_pubkeys,zcash); |
|
|
|
for (i=0; i<len; i++) |
|
|
|
printf("%02x",serialized[i]); |
|
|
|
printf(" <- sigtx len.%d supp.%d user[0].%d\n",len,suppress_pubkeys,dest.vins[0].userdatalen); |
|
|
|
//for (i=0; i<len; i++)
|
|
|
|
// printf("%02x",serialized[i]);
|
|
|
|
//printf(" <- sigtx len.%d supp.%d user[0].%d\n",len,suppress_pubkeys,dest.vins[0].userdatalen);
|
|
|
|
if ( len > 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; i<sizeof(revsigtxid); i++) |
|
|
|
sigtxid.bytes[31-i] = revsigtxid.bytes[i]; |
|
|
|
char str[65]; printf("SIGTXID.(%s) numvouts.%d\n",bits256_str(str,sigtxid),dest.tx_out); |
|
|
|
//char str[65]; printf("SIGTXID.(%s) numvouts.%d\n",bits256_str(str,sigtxid),dest.tx_out);
|
|
|
|
} |
|
|
|
free(dest.vins); |
|
|
|
free(dest.vouts); |
|
|
@ -3411,7 +3410,7 @@ int32_t iguana_rwmsgtx(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t is |
|
|
|
} |
|
|
|
for (i=0; i<msg->tx_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 ) |
|
|
|