|
|
@ -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<COutput> 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<std::pair<CAddressUnspentKey, CAddressUnspentValue> > 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; |
|
|
|