Remove spendable 0-value outputs from consensus, wallet

This commit is contained in:
Gregory Sanders 2017-03-30 15:03:50 -04:00
parent 366bdec11f
commit 2ac5eafbca
3 changed files with 14 additions and 4 deletions

View file

@ -166,6 +166,15 @@ bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>
return false;
}
// An rangeproof is not valid if the output is spendable but the minimum number
// is 0. This is to prevent people passing 0-value tokens around, or conjuring
// reissuance tokens from nothing then attempting to reissue an asset.
// ie reissuance doesn't require revealing value of reissuance output
// Issuances proofs are always "unspendable" as they commit to an empty script.
if (min_value == 0 && !scriptPubKey.IsUnspendable()) {
return false;
}
return true;
}