mirror of https://github.com/oxen-io/oxen-core.git
Ensure we don't produce a HF block with garbage from the db
Fix edge case where the block producer has garbage in the db: the code that clears it happens when we *accept* the block, but we can end up here before then, when we produce the block, so just return empty in such a case.
This commit is contained in:
parent
4848cacec8
commit
fd4ca4a57c
|
@ -189,7 +189,10 @@ namespace cryptonote {
|
|||
std::optional<std::vector<cryptonote::batch_sn_payment>> BlockchainSQLite::get_sn_payments(uint64_t block_height) {
|
||||
LOG_PRINT_L3("BlockchainDB_SQLITE::" << __func__);
|
||||
|
||||
if (block_height == 0)
|
||||
// <= here because we might have crap in the db that we don't clear until we actually add the HF
|
||||
// block later on. (This is a pretty slim edge case that happened on devnet and is probably
|
||||
// virtually impossible on mainnet).
|
||||
if (block_height <= cryptonote::get_hard_fork_heights(m_nettype, hf::hf19_reward_batching).first.value_or(0))
|
||||
return std::nullopt;
|
||||
|
||||
const auto& conf = get_config(m_nettype);
|
||||
|
|
Loading…
Reference in New Issue