From 1c105377e150cda0b1c86268c73e9d729827e9c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Jul 2018 02:08:43 -1100 Subject: [PATCH] Fix --- src/cc/assets.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index 8ceaf91dc..e1bc70a24 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -251,7 +251,7 @@ void Myprivkey(uint8_t myprivkey[]) { n = (int32_t)strlen(coinaddr); strAddress.resize(n+1); - dest = strAddress.data(); + dest = (char *)strAddress.data(); for (i=0; i= totalout+2*txfee ) + if ( totalinputs >= totaloutputs+2*txfee ) { change = totalinputs - (totalout+txfee); mtx.vout.push_back(CTxOut(change,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); @@ -521,9 +521,10 @@ std::string FinalizeCCTx(uint8_t evalcode,CMutableTransaction &mtx,CPubKey mypk, { if ( GetTransaction(mtx.vin[i].prevout.hash,vintx,hashBlock,false) != 0 ) { + utxovout = mtx.vin[i].prevout.n; if ( SignTx(mtx,i,vintx.vout[utxovout].nValue,vintx.vout[utxovout].scriptPubKey) == 0 ) - fprintf(stderr,"signing error for vini.%d of %llx\n",vini,(long long)vinimask); - } else fprintf(stderr,"FinalizeAssetTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString()); + fprintf(stderr,"signing error for vini.%d of %llx\n",i,(long long)vinimask); + } else fprintf(stderr,"FinalizeAssetTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString().c_str()); } } std::string strHex = EncodeHexTx(mtx); @@ -601,7 +602,8 @@ uint64_t AddCCinputs(CMutableTransaction &mtx,CPubKey mypk,uint256 assetid,uint6 uint64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,uint64_t total,int32_t maxinputs) { - int32_t n = 0; uint64_t totalinputs = 0; + int32_t n = 0; uint64_t nValue,totalinputs = 0; vector vecOutputs; +#ifdef ENABLE_WALLET const CKeyStore& keystore = *pwalletMain; assert(pwalletMain != NULL); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -619,7 +621,8 @@ uint64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,uint64_t total,in } if ( totalinputs >= total ) return(totalinputs); - else return(0); +#endif + return(0); } std::string CreateAsset(std::vector mypubkey,uint64_t txfee,uint64_t assetsupply,std::string name,std::string description)