Do not skip pushing of vMatch and vHashes in CMerkleBlock (#2826)

Even if its a TX type which we don't want in merkle blocks. Wrongfully
omitting the pushes causes invalid partial merkle trees, which in turn
causes SPV nodes to ban us.
This commit is contained in:
Alexander Block 2019-04-04 08:11:04 +02:00
parent 8c58799d8d
commit 575cafc011

View File

@ -31,12 +31,10 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)
for (unsigned int i = 0; i < block.vtx.size(); i++)
{
const auto& tx = *block.vtx[i];
if (tx.nVersion == 3 && !allowedTxTypes.count(tx.nType)) {
continue;
}
const uint256& hash = tx.GetHash();
if (filter.IsRelevantAndUpdate(tx))
bool isAllowedType = tx.nVersion != 3 || allowedTxTypes.count(tx.nType) != 0;
if (isAllowedType && filter.IsRelevantAndUpdate(tx))
{
vMatch.push_back(true);
vMatchedTxn.push_back(std::make_pair(i, hash));