Added mapSerials consensus rules to prohibit double-spending.

This commit is contained in:
Sean Bowe
2016-01-08 08:37:17 -07:00
parent 03bff15fe2
commit d66877afb3
8 changed files with 224 additions and 4 deletions

View File

@@ -391,6 +391,15 @@ bool CCoinsViewCache::HavePourRequirements(const CTransaction& tx) const
{
BOOST_FOREACH(const CPourTx &pour, tx.vpour)
{
BOOST_FOREACH(const uint256& serial, pour.serials)
{
if (GetSerial(serial)) {
// If the serial is set, this transaction
// double-spends!
return false;
}
}
libzerocash::IncrementalMerkleTree tree(INCREMENTAL_MERKLE_TREE_DEPTH);
if (!GetAnchorAt(pour.anchor, tree)) {
// If we do not have the anchor for the pour,