Skip to content

Commit

Permalink
Don't serialize expired persistent states (#935)
Browse files Browse the repository at this point in the history
Co-authored-by: SpyCheese <[email protected]>
  • Loading branch information
EmelyanenkoK and SpyCheese authored Mar 19, 2024
1 parent f159264 commit 0a82a19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion validator/state-serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ bool AsyncStateSerializer::need_serialize(BlockHandle handle) {
if (handle->id().id.seqno == 0 || !handle->is_key_block()) {
return false;
}
return ValidatorManager::is_persistent_state(handle->unix_time(), last_key_block_ts_);
return ValidatorManager::is_persistent_state(handle->unix_time(), last_key_block_ts_) &&
ValidatorManager::persistent_state_ttl(handle->unix_time()) > (UnixTime)td::Clocks::system();
}

} // namespace validator
Expand Down

0 comments on commit 0a82a19

Please sign in to comment.