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

@@ -473,8 +473,6 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
{
if (tx.IsCoinBase())
return 0.0;
//CAmount nTotalIn = 0;
// Joinsplits do not reveal any information about the value or age of a note, so we
// cannot apply the priority algorithm used for transparent utxos. Instead, we just
// use the maximum priority whenever a transaction contains any JoinSplits.
@@ -493,34 +491,9 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
if (!coins->IsAvailable(txin.prevout.n)) continue;
if (coins->nHeight < nHeight) {
dResult += coins->vout[txin.prevout.n].nValue * (nHeight-coins->nHeight);
//nTotalIn += coins->vout[txin.prevout.n].nValue;
}
}
// If a transaction contains a joinsplit, we boost the priority of the transaction.
// Joinsplits do not reveal any information about the value or age of a note, so we
// cannot apply the priority algorithm used for transparent utxos. Instead, we pick a
// very large number and multiply it by the transaction's fee per 1000 bytes of data.
// One trillion, 1000000000000, is equivalent to 1 ZEC utxo * 10000 blocks (~17 days).
/*if (tx.vjoinsplit.size() > 0) {
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
nTotalIn += tx.GetJoinSplitValueIn();
CAmount fee = nTotalIn - tx.GetValueOut();
CFeeRate feeRate(fee, nTxSize);
CAmount feePerK = feeRate.GetFeePerK();
if (feePerK == 0) {
feePerK = 1;
}
dResult += 1000000000000 * double(feePerK);
// We cast feePerK from int64_t to double because if feePerK is a large number, say
// close to MAX_MONEY, the multiplication operation will result in an integer overflow.
// The variable dResult should never overflow since a 64-bit double in C++ is typically
// a double-precision floating-point number as specified by IEE 754, with a maximum
// value DBL_MAX of 1.79769e+308.
}*/
return tx.ComputePriority(dResult);
}