Browse Source

Test

etomic
jl777 7 years ago
parent
commit
0fe737742d
  1. 14
      iguana/exchanges/LP_bitcoin.c

14
iguana/exchanges/LP_bitcoin.c

@ -3447,17 +3447,17 @@ bits256 bitcoin_sigtxid(char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2sht
len += iguana_rwnum(1,&serialized[len],sizeof(dest.vins[i].prev_vout),&dest.vins[i].prev_vout);
}
prevouthash = bits256_doublesha256(0,serialized,len);
for (i=len=0; i<dest.tx_in; i++)
len += iguana_rwnum(1,&serialized[len],sizeof(dest.vins[i].sequence),&dest.vins[i].sequence);
//hashSequence:
// dSHA256(eeffffffffffffff)
// = 52b0a642eea2fb7ae638c36f6252b6750293dbe574a806984b8e4d8548339a3b
len = 0;
dest.vins[0].sequence = 0xffffffee;
len += iguana_rwnum(1,&serialized[len],sizeof(dest.vins[0].sequence),&dest.vins[0].sequence);
// dSHA256(ffffffffffffffff)
// = 3bb13029ce7b1f559ef5e747fcac439f1455a2ec7c5f09b72290795e70665044
seqhash = bits256_doublesha256(0,serialized,len);
char str[65]; printf("sequenceid %08x -> %s\n",dest.vins[0].sequence,bits256_str(str,seqhash)); getchar();
for (i=0; i<len; i++)
printf("%02x",serialized[i]);
char str[65]; printf(" sequenceid %08x -> %s\n",dest.vins[0].sequence,bits256_str(str,seqhash)); getchar();
for (i=len=0; i<dest.tx_out; i++)
len += iguana_voutparse(1,&serialized[len],&dest.vouts[i]);
outputhash = bits256_doublesha256(0,serialized,len);

Loading…
Cancel
Save