From 13b038a9b9345942f4f6302e8c24566851f1a2b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 21 Nov 2018 01:36:32 -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 +- src/consensus/consensus.h | 2 +- src/deprecation.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index 69f685cf3..b94e1372c 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -349,7 +349,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 2a736ea1b..baa32b856 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 f8cec6fcb..d70ceb3e5 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 95f032e8e..06002f9c0 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; diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 50cac5531..829959dea 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -24,7 +24,7 @@ static const unsigned int MAX_BLOCK_SIZE = 2000000; extern unsigned int MAX_BLOCK_SIGOPS; /** The maximum size of a transaction (network rule) */ static const unsigned int MAX_TX_SIZE_BEFORE_SAPLING = 100000; -static const unsigned int MAX_TX_SIZE_AFTER_SAPLING = MAX_BLOCK_SIZE; +static const unsigned int MAX_TX_SIZE_AFTER_SAPLING = (2 * MAX_TX_SIZE_BEFORE_SAPLING); //MAX_BLOCK_SIZE; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ extern int COINBASE_MATURITY; /** The minimum value which is invalid for expiry height, used by CTransaction and CMutableTransaction */ diff --git a/src/deprecation.h b/src/deprecation.h index a63a0084e..16484ed5a 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -9,7 +9,7 @@ // * Shut down WEEKS_UNTIL_DEPRECATION weeks' worth of blocks after the estimated release block height. // * A warning is shown during the DEPRECATION_WARN_LIMIT worth of blocks prior to shut down. static const int WEEKS_UNTIL_DEPRECATION = 52; -static const int DEPRECATION_HEIGHT = 1400000; +static const int DEPRECATION_HEIGHT = 1600000; static const int APPROX_RELEASE_HEIGHT = DEPRECATION_HEIGHT - (WEEKS_UNTIL_DEPRECATION * 7 * 24 * 60); // Number of blocks before deprecation to warn users