mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Remove spendable 0-value outputs from consensus, wallet
This commit is contained in:
parent
366bdec11f
commit
2ac5eafbca
3 changed files with 14 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue