Skip to content

Commit 1912743

Browse files
committed
fixme: prevent crash after new block is found
This doesn't solve the underlying problem.
1 parent 3447a19 commit 1912743

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/node/sv2_template_provider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ void Sv2TemplateProvider::PruneBlockTemplateCache()
365365
// If the blocks prevout is not the tip's prevout, delete it.
366366
uint256 prev_hash = m_best_prev_hash;
367367
std::erase_if(m_block_template_cache, [prev_hash] (const auto& kv) {
368+
// TODO: this shouldn't happen, but it does.
369+
// Investigate after the mining interface is merged / stable.
370+
// When trying testnet4 mining, using only the pool role,
371+
// the node would crash immediately after finding a block.
372+
if (!kv.second) return true;
368373
if (kv.second->getBlockHeader().hashPrevBlock != prev_hash) {
369374
return true;
370375
}

0 commit comments

Comments
 (0)