Merge remote-tracking branch 'zcash/master' into rebase2

# Conflicts:
#	.travis.yml
#	Makefile.am
#	README.md
#	configure.ac
#	depends/Makefile
#	depends/builders/darwin.mk
#	depends/funcs.mk
#	depends/hosts/darwin.mk
#	depends/packages/googlemock.mk
#	depends/packages/googletest.mk
#	depends/packages/libsnark.mk
#	depends/packages/libsodium.mk
#	depends/packages/packages.mk
#	depends/packages/rust.mk
#	src/Makefile.am
#	src/Makefile.gtest.include
#	src/chainparams.cpp
#	src/chainparams.h
#	src/checkpoints.h
#	src/clientversion.h
#	src/coins.cpp
#	src/consensus/consensus.h
#	src/gtest/test_mempool.cpp
#	src/httprpc.cpp
#	src/init.cpp
#	src/komodo-tx.cpp
#	src/main.cpp
#	src/miner.cpp
#	src/policy/fees.cpp
#	src/policy/fees.h
#	src/rpcmining.cpp
#	src/rpcrawtransaction.cpp
#	src/rpcserver.cpp
#	src/test/policyestimator_tests.cpp
#	src/test/rpc_wallet_tests.cpp
#	src/test/transaction_tests.cpp
#	src/txdb.cpp
#	src/txmempool.cpp
#	src/wallet/asyncrpcoperation_sendmany.cpp
#	src/wallet/rpcwallet.cpp
#	src/wallet/wallet.cpp
#	src/wallet/wallet.h
#	src/zcash/CreateJoinSplit.cpp
#	zcutil/build.sh
This commit is contained in:
jl777
2018-03-25 18:44:38 +03:00
603 changed files with 55577 additions and 9837 deletions

View File

@@ -16,14 +16,12 @@ void TxConfirmStats::Initialize(std::vector<double>& defaultBuckets,
{
decay = _decay;
dataTypeString = _dataTypeString;
//for (unsigned int i = 0; i < defaultBuckets.size(); i++) {
// buckets.push_back(defaultBuckets[i]);
// bucketMap[defaultBuckets[i]] = i;
buckets.insert(buckets.end(), defaultBuckets.begin(), defaultBuckets.end());
buckets.push_back(std::numeric_limits<double>::infinity());
for (unsigned int i = 0; i < buckets.size(); i++) {
bucketMap[buckets[i]] = i;
}
confAvg.resize(maxConfirms);
curBlockConf.resize(maxConfirms);
unconfTxs.resize(maxConfirms);
@@ -57,7 +55,6 @@ unsigned int TxConfirmStats::FindBucketIndex(double val)
{
extern char ASSETCHAINS_SYMBOL[];
auto it = bucketMap.lower_bound(val);
//assert(it != bucketMap.end());
if ( it != bucketMap.end() )
{
static uint32_t counter;
@@ -72,7 +69,6 @@ void TxConfirmStats::Record(int blocksToConfirm, double val)
// blocksToConfirm is 1-based
if (blocksToConfirm < 1)
return;
//unsigned int bucketindex = bucketMap.lower_bound(val)->second;
unsigned int bucketindex = FindBucketIndex(val);
for (size_t i = blocksToConfirm; i <= curBlockConf.size(); i++) {
curBlockConf[i - 1][bucketindex]++;
@@ -264,7 +260,6 @@ void TxConfirmStats::Read(CAutoFile& filein)
unsigned int TxConfirmStats::NewTx(unsigned int nBlockHeight, double val)
{
//unsigned int bucketindex = bucketMap.lower_bound(val)->second;
unsigned int bucketindex = FindBucketIndex(val);
unsigned int blockIndex = nBlockHeight % unconfTxs.size();
unconfTxs[blockIndex][bucketindex]++;
@@ -325,7 +320,6 @@ CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
for (double bucketBoundary = minTrackedFee.GetFeePerK(); bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
vfeelist.push_back(bucketBoundary);
}
//vfeelist.push_back(INF_FEERATE);
feeStats.Initialize(vfeelist, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY, "FeeRate");
minTrackedPriority = AllowFreeThreshold() < MIN_PRIORITY ? MIN_PRIORITY : AllowFreeThreshold();
@@ -333,7 +327,6 @@ CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
for (double bucketBoundary = minTrackedPriority; bucketBoundary <= MAX_PRIORITY; bucketBoundary *= PRI_SPACING) {
vprilist.push_back(bucketBoundary);
}
//vprilist.push_back(INF_PRIORITY);
priStats.Initialize(vprilist, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY, "Priority");
feeUnlikely = CFeeRate(0);