diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 464fa16d1..0a0a59cfb 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -635,8 +635,6 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch } jaddbits256(item,"txid",utxotxid); jaddnum(item,"vout",vout); - bitcoin_address(tmpaddr,pubtype,pubkey33,33); - bitcoin_addr2rmd160(&addrtype,rmd160,tmpaddr); /*int32_t i; for (i=0; i<33; i++) printf("%02x",pubkey33[i]); @@ -653,9 +651,16 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { init_hexbytes_noT(hexstr,redeemscript,redeemlen); jaddstr(item,"redeemScript",hexstr); + calc_rmd160_sha256(rmd160,redeemscript,redeemlen); spendlen = bitcoin_p2shspend(spendscript,0,rmd160); printf("P2SH path\n"); - } else spendlen = bitcoin_standardspend(spendscript,0,rmd160); + } + else + { + bitcoin_address(tmpaddr,pubtype,pubkey33,33); + bitcoin_addr2rmd160(&addrtype,rmd160,tmpaddr); + spendlen = bitcoin_standardspend(spendscript,0,rmd160); + } init_hexbytes_noT(hexstr,spendscript,spendlen); jaddstr(item,"scriptPubKey",hexstr); jaddnum(item,"suppress",suppress_pubkeys);