Auto merge of #3548 - Eirik0:3546-sapling-coin-priority, r=bitcartel

Use max priority for all shielded transactions

Addresses https://github.com/zcash/zcash/issues/3546#issuecomment-425184034
This commit is contained in:
Homu
2018-10-01 10:13:15 -07:00
2 changed files with 22 additions and 7 deletions

View File

@@ -616,16 +616,16 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
if (tx.IsCoinBase())
return 0.0;
// Joinsplits do not reveal any information about the value or age of a note, so we
// Shielded transfers 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.
// (Note that coinbase transactions cannot contain JoinSplits.)
// FIXME: this logic is partially duplicated between here and CreateNewBlock in miner.cpp.
// use the maximum priority for all (partially or fully) shielded transactions.
// (Note that coinbase transactions cannot contain JoinSplits, or Sapling shielded Spends or Outputs.)
if (tx.vjoinsplit.size() > 0) {
if (tx.vjoinsplit.size() > 0 || tx.vShieldedSpend.size() > 0 || tx.vShieldedOutput.size() > 0) {
return MAX_PRIORITY;
}
// FIXME: this logic is partially duplicated between here and CreateNewBlock in miner.cpp.
double dResult = 0.0;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{