From 547998f53651c7b333cd5ce4d6f461560b927455 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 21 Nov 2018 01:37:36 -1100 Subject: [PATCH] maxinputs+1 --- src/cc/CCtx.cpp | 2 +- src/cc/faucet.cpp | 2 +- src/cc/gateways.cpp | 2 +- src/cc/rewards.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index d927119d6..df6c8e73c 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -348,7 +348,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); utxos = (struct CC_utxo *)calloc(maxutxos,sizeof(*utxos)); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); if ( maxinputs > maxutxos ) maxutxos = maxinputs; sum = 0; diff --git a/src/cc/faucet.cpp b/src/cc/faucet.cpp index 3bf8a3476..6aab25326 100644 --- a/src/cc/faucet.cpp +++ b/src/cc/faucet.cpp @@ -146,7 +146,7 @@ int64_t AddFaucetInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; diff --git a/src/cc/gateways.cpp b/src/cc/gateways.cpp index a9fc6a4cd..19afb2ec7 100644 --- a/src/cc/gateways.cpp +++ b/src/cc/gateways.cpp @@ -336,7 +336,7 @@ int64_t AddGatewaysInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CP std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); fprintf(stderr,"check %s for gateway inputs\n",coinaddr); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 649a9a9e6..f41a84a27 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -333,7 +333,7 @@ int64_t AddRewardsInputs(CScript &scriptPubKey,uint64_t maxseconds,struct CCcont std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash;