diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 203a9c868..53a2d050f 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -290,8 +290,8 @@ std::string FinalizeCCTx(uint64_t skipmask,struct CCcontract_info *cp,CMutableTr void SetCCunspents(std::vector > &unspentOutputs,char *coinaddr,bool CCflag = true); void SetCCtxids(std::vector > &addressIndex,char *coinaddr,bool CCflag = true); int64_t NSPV_AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr); -int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr = 0); -int64_t AddNormalinputs2(CMutableTransaction &mtx,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr = 0); +int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs); +int64_t AddNormalinputs2(CMutableTransaction &mtx,int64_t total,int32_t maxinputs); int64_t CCutxovalue(char *coinaddr,uint256 utxotxid,int32_t utxovout,int32_t CCflag); bool NSPV_SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const CScript scriptPubKey,uint32_t nTime); diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index 977c1e37a..121271561 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -521,15 +521,11 @@ int32_t CC_vinselect(int32_t *aboveip,int64_t *abovep,int32_t *belowip,int64_t * else return(belowi); } -int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr) +int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs) { int32_t abovei,belowi,ind,vout,i,n = 0; int64_t sum,threshold,above,below; int64_t remains,nValue,totalinputs = 0; uint256 txid,hashBlock; std::vector vecOutputs; CTransaction tx; struct CC_utxo *utxos,*up; if ( KOMODO_NSPV != 0 ) - { - if ( ptr != 0 ) - return(NSPV_AddNormalinputs(mtx,mypk,total,maxinputs,ptr)); - else return(0); - } + return(NSPV_AddNormalinputs(mtx,mypk,total,maxinputs,&NSPV_U)); #ifdef ENABLE_WALLET assert(pwalletMain != NULL); const CKeyStore& keystore = *pwalletMain; @@ -621,12 +617,12 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 return(0); } -int64_t AddNormalinputs2(CMutableTransaction &mtx,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr) +int64_t AddNormalinputs2(CMutableTransaction &mtx,int64_t total,int32_t maxinputs) { int32_t abovei,belowi,ind,vout,i,n = 0; int64_t sum,threshold,above,below; int64_t remains,nValue,totalinputs = 0; char coinaddr[64]; uint256 txid,hashBlock; CTransaction tx; struct CC_utxo *utxos,*up; std::vector > unspentOutputs; if ( KOMODO_NSPV != 0 ) - return(NSPV_AddNormalinputs(mtx,pubkey2pk(Mypubkey()),total,maxinputs,ptr)); + return(NSPV_AddNormalinputs(mtx,pubkey2pk(Mypubkey()),total,maxinputs,&NPSV_U)); utxos = (struct CC_utxo *)calloc(CC_MAXVINS,sizeof(*utxos)); if ( maxinputs > CC_MAXVINS ) maxinputs = CC_MAXVINS;