|
|
@ -150,8 +150,16 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran |
|
|
|
utxovout = mtx.vin[i].prevout.n; |
|
|
|
if ( vintx.vout[utxovout].scriptPubKey.IsPayToCryptoCondition() == 0 ) |
|
|
|
{ |
|
|
|
if ( SignTx(mtx,i,vintx.vout[utxovout].nValue,vintx.vout[utxovout].scriptPubKey) == 0 ) |
|
|
|
fprintf(stderr,"signing error for vini.%d of %llx\n",i,(long long)vinimask); |
|
|
|
if ( KOMODO_NSPV == 0 ) |
|
|
|
{ |
|
|
|
if ( SignTx(mtx,i,vintx.vout[utxovout].nValue,vintx.vout[utxovout].scriptPubKey) == 0 ) |
|
|
|
fprintf(stderr,"signing error for vini.%d of %llx\n",i,(long long)vinimask); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ( NSPV_SignTx(mtx,i,vintx.vout[utxovout].nValue,vintx.vout[utxovout].scriptPubKey) == 0 ) |
|
|
|
fprintf(stderr,"NSPV signing error for vini.%d of %llx\n",i,(long long)vinimask); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -510,6 +518,10 @@ int32_t CC_vinselect(int32_t *aboveip,int64_t *abovep,int32_t *belowip,int64_t * |
|
|
|
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 ) |
|
|
|
{ |
|
|
|
//return(NSPV_addinputs(struct NSPV_utxoresp *used,CMutableTransaction &mtx,int64_t total,int32_t maxinputs,struct NSPV_utxoresp *ptr,int32_t num));
|
|
|
|
} |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
assert(pwalletMain != NULL); |
|
|
|
const CKeyStore& keystore = *pwalletMain; |
|
|
@ -605,6 +617,10 @@ int64_t AddNormalinputs2(CMutableTransaction &mtx,int64_t total,int32_t maxinput |
|
|
|
{ |
|
|
|
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_addinputs(struct NSPV_utxoresp *used,CMutableTransaction &mtx,int64_t total,int32_t maxinputs,struct NSPV_utxoresp *ptr,int32_t num));
|
|
|
|
} |
|
|
|
utxos = (struct CC_utxo *)calloc(CC_MAXVINS,sizeof(*utxos)); |
|
|
|
if ( maxinputs > CC_MAXVINS ) |
|
|
|
maxinputs = CC_MAXVINS; |
|
|
|