diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index cfd450f14..fc7a293fd 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -299,7 +299,7 @@ std::string NSPV_signtx(int64_t &rewardsum,int64_t &interestsum,UniValue &retcod UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its all about! { - UniValue result(UniValue::VOBJ),retcodes(UniValue::VARR); std::vector data; CScript scriptPubKey; uint8_t rmd160[128]; int64_t txfee = 10000; + UniValue result(UniValue::VOBJ),retcodes(UniValue::VARR); CScript scriptPubKey; uint8_t *data,rmd160[128]; int32_t len; int64_t txfee = 10000; if ( NSPV_logintime == 0 || time(NULL) > NSPV_logintime+NSPV_AUTOLOGOUT ) { result.push_back(Pair("result","error")); @@ -315,8 +315,13 @@ UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its a } else if ( bitcoin_base58decode(rmd160,destaddr) != 25 ) { - if ( is_hexstr(destaddr,0) > 0 ) - scriptPubKey = CScript() << ParseHex(destaddr); + if ( (len= is_hexstr(destaddr,0)) > 0 ) + { + len >>= 1; + scriptPubKey.resize(len); + data = (uint8_t *)scriptPubKey.begin(); + decode_hex(data,len,destaddr); + } else { result.push_back(Pair("result","error")); diff --git a/src/main.cpp b/src/main.cpp index 8f0225f27..d2b16b2a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2224,7 +2224,6 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo { int64_t rewardsum = 0; int32_t retval,vout = 0; retval = NSPV_gettransaction(1,vout,hash,0,txOut,0,0,rewardsum); - fprintf(stderr,"myGetTransaction retval.%d\n",retval); return(retval == 0); } // need a GetTransaction without lock so the validation code for assets can run without deadlock