diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 306112144..1c2c5d0c5 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/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; izcash = 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); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 88816aab2..ad297bd75 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/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 ) {