We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 041ceba commit e86cf0cCopy full SHA for e86cf0c
src/gridcoin/mrc.cpp
@@ -112,7 +112,12 @@ CAmount MRC::ComputeMRCFee() const
112
const int64_t last_reward_time = account.LastRewardTime();
113
114
// Get the block index of the head of the chain at the time the MRC was filled out.
115
- CBlockIndex* prev_block_pindex = mapBlockIndex[m_last_block_hash];
+ auto block_index_element = mapBlockIndex.find(m_last_block_hash);
116
+
117
+ // If the mrc last block hash is not in the block index map, just return zero.
118
+ if (block_index_element == mapBlockIndex.end()) return fee;
119
120
+ CBlockIndex* prev_block_pindex = block_index_element->second;
121
122
int64_t payment_time = prev_block_pindex->nTime;
123
0 commit comments