Ensure mempool integrity checks don't trip on chained joinsplits.
This commit is contained in:
parent
47e6645005
commit
a667caec13
|
@ -314,15 +314,29 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
|||
assert(it3->second.n == i);
|
||||
i++;
|
||||
}
|
||||
|
||||
boost::unordered_map<uint256, ZCIncrementalMerkleTree, CCoinsKeyHasher> intermediates;
|
||||
|
||||
BOOST_FOREACH(const CPourTx &pour, tx.vpour) {
|
||||
BOOST_FOREACH(const uint256 &serial, pour.serials) {
|
||||
assert(!pcoins->GetSerial(serial));
|
||||
}
|
||||
|
||||
// TODO: chained pours
|
||||
ZCIncrementalMerkleTree tree;
|
||||
auto it = intermediates.find(pour.anchor);
|
||||
if (it != intermediates.end()) {
|
||||
tree = it->second;
|
||||
} else {
|
||||
assert(pcoins->GetAnchorAt(pour.anchor, tree));
|
||||
}
|
||||
|
||||
BOOST_FOREACH(const uint256& commitment, pour.commitments)
|
||||
{
|
||||
tree.append(commitment);
|
||||
}
|
||||
|
||||
intermediates.insert(std::make_pair(tree.root(), tree));
|
||||
}
|
||||
if (fDependsWait)
|
||||
waitingOnDependants.push_back(&it->second);
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue