aboutsummaryrefslogtreecommitdiff
path: root/src/merkleblock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/merkleblock.cpp')
-rw-r--r--src/merkleblock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/merkleblock.cpp b/src/merkleblock.cpp
index ba5f7b400c..f0abea0611 100644
--- a/src/merkleblock.cpp
+++ b/src/merkleblock.cpp
@@ -59,6 +59,9 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, const std::set<uint256>& txids)
}
uint256 CPartialMerkleTree::CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid) {
+ //we can never have zero txs in a merkle block, we always need the coinbase tx
+ //if we do not have this assert, we can hit a memory access violation when indexing into vTxid
+ assert(vTxid.size() != 0);
if (height == 0) {
// hash at height 0 is the txids themself
return vTxid[pos];