Added mapAnchors consensus rules, finished zcrawpour/zcrawreceive.
Some specifics on consensus changes: * Transactions must be anchored to a real anchor in the chain. * Anchors are pushed and popped during ConnectBlock/DisconnectBlock as appropriate. * DisconnectTip triggers evictions, under some circumstances, of transactions in the mempool which are anchored to roots that are no longer valid. * Commitments append to the tree at the current best root during ConnectBlock.
This commit is contained in:
@@ -387,6 +387,21 @@ CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
|
||||
return nResult;
|
||||
}
|
||||
|
||||
bool CCoinsViewCache::HavePourRequirements(const CTransaction& tx) const
|
||||
{
|
||||
BOOST_FOREACH(const CPourTx &pour, tx.vpour)
|
||||
{
|
||||
libzerocash::IncrementalMerkleTree tree(INCREMENTAL_MERKLE_TREE_DEPTH);
|
||||
if (!GetAnchorAt(pour.anchor, tree)) {
|
||||
// If we do not have the anchor for the pour,
|
||||
// it is invalid.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
|
||||
{
|
||||
if (!tx.IsCoinBase()) {
|
||||
|
||||
Reference in New Issue
Block a user