1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Don't serialize expired persistent states (#935)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-03-19 15:43:03 +03:00 committed by GitHub
parent f1592641de
commit 0a82a19313
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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