Browse Source

Test

etomic
jl777 7 years ago
parent
commit
c61811e96f
  1. 7
      iguana/exchanges/LP_bitcoin.c
  2. 2
      iguana/exchanges/LP_coins.c
  3. 2
      iguana/exchanges/LP_transaction.c

7
iguana/exchanges/LP_bitcoin.c

@ -3244,7 +3244,7 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i
memcpy(dest.vins,msgtx->vins,dest.tx_in * sizeof(*dest.vins));
memcpy(dest.vouts,msgtx->vouts,dest.tx_out * sizeof(*dest.vouts));
memset(sigtxid.bytes,0,sizeof(sigtxid));
if ( hashtype != SIGHASH_ALL )
if ( (hashtype & ~SIGHASH_FORKID) != SIGHASH_ALL )
{
printf("currently only SIGHASH_ALL supported, not %d\n",hashtype);
return(sigtxid);
@ -3279,11 +3279,6 @@ bits256 bitcoin_sigtxid(uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t i
if ( height >= BTC2_HARDFORK_HEIGHT )
hashtype |= (0x777 << 20);
#endif
if ( zcash == LP_IS_BITCOINCASH )
{
hashtype |= SIGHASH_FORKID;
printf("hashtype is %04x\n",hashtype);
}
len += iguana_rwnum(1,&serialized[len],sizeof(hashtype),&hashtype);
revsigtxid = bits256_doublesha256(0,serialized,len);
for (i=0; i<sizeof(revsigtxid); i++)

2
iguana/exchanges/LP_coins.c

@ -337,7 +337,7 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse
else if ( strcmp(symbol,"BCH") == 0 )
{
coin->zcash = LP_IS_BITCOINCASH;
printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash);
//printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash);
}
return(port);
}

2
iguana/exchanges/LP_transaction.c

@ -401,6 +401,8 @@ int32_t bitcoin_verifyvins(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype,
script = msgtx->vins[vini].spendscript;
scriptlen = msgtx->vins[vini].spendlen;
}
if ( zcash == LP_IS_BITCOINCASH )
sighash |= SIGHASH_FORKID;
sigtxid = bitcoin_sigtxid(taddr,pubtype,p2shtype,isPoS,height,serialized,maxlen,msgtx,vini,script,scriptlen,sighash,vpnstr,suppress_pubkeys,zcash);
if ( bits256_nonz(sigtxid) != 0 )
{

Loading…
Cancel
Save