Skip to content

Commit b0850fa

Browse files
authored
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.
1 parent 1225667 commit b0850fa

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/merkleblock.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)
3131
for (unsigned int i = 0; i < block.vtx.size(); i++)
3232
{
3333
const auto& tx = *block.vtx[i];
34-
if (tx.nVersion == 3 && !allowedTxTypes.count(tx.nType)) {
35-
continue;
36-
}
37-
3834
const uint256& hash = tx.GetHash();
39-
if (filter.IsRelevantAndUpdate(tx))
35+
bool isAllowedType = tx.nVersion != 3 || allowedTxTypes.count(tx.nType) != 0;
36+
37+
if (isAllowedType && filter.IsRelevantAndUpdate(tx))
4038
{
4139
vMatch.push_back(true);
4240
vMatchedTxn.push_back(std::make_pair(i, hash));

0 commit comments

Comments
 (0)