diff options
Diffstat (limited to 'src/blockfilter.cpp')
-rw-r--r-- | src/blockfilter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/blockfilter.cpp b/src/blockfilter.cpp index 38fcfacf7f..91623fe70a 100644 --- a/src/blockfilter.cpp +++ b/src/blockfilter.cpp @@ -208,7 +208,7 @@ static GCSFilter::ElementSet BasicFilterElements(const CBlock& block, for (const CTransactionRef& tx : block.vtx) { for (const CTxOut& txout : tx->vout) { const CScript& script = txout.scriptPubKey; - if (script[0] == OP_RETURN) continue; + if (script.empty() || script[0] == OP_RETURN) continue; elements.emplace(script.begin(), script.end()); } } @@ -216,6 +216,7 @@ static GCSFilter::ElementSet BasicFilterElements(const CBlock& block, for (const CTxUndo& tx_undo : block_undo.vtxundo) { for (const Coin& prevout : tx_undo.vprevout) { const CScript& script = prevout.out.scriptPubKey; + if (script.empty()) continue; elements.emplace(script.begin(), script.end()); } } |