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

bugfix in import slice

This commit is contained in:
ton 2020-02-21 14:43:20 +04:00
parent efd47af432
commit 9e4816e7f6

View file

@ -201,19 +201,13 @@ void ArchiveImporter::got_new_materchain_state(td::Ref<MasterchainState> state)
} }
void ArchiveImporter::checked_all_masterchain_blocks(BlockSeqno seqno) { void ArchiveImporter::checked_all_masterchain_blocks(BlockSeqno seqno) {
if (shard_client_seqno_ > seqno) {
shard_client_seqno_ = seqno;
}
check_next_shard_client_seqno(shard_client_seqno_ + 1); check_next_shard_client_seqno(shard_client_seqno_ + 1);
} }
void ArchiveImporter::check_next_shard_client_seqno(BlockSeqno seqno) { void ArchiveImporter::check_next_shard_client_seqno(BlockSeqno seqno) {
if (seqno > state_->get_seqno()) { if (seqno > state_->get_seqno()) {
finish_query(); finish_query();
return; } else if (seqno == state_->get_seqno()) {
}
if (seqno == state_->get_seqno()) {
got_masterchain_state(state_); got_masterchain_state(state_);
} else { } else {
BlockIdExt b; BlockIdExt b;
@ -368,7 +362,8 @@ void ArchiveImporter::abort_query(td::Status error) {
} }
void ArchiveImporter::finish_query() { void ArchiveImporter::finish_query() {
if (promise_) { if (promise_) {
promise_.set_value(std::vector<BlockSeqno>{state_->get_seqno(), shard_client_seqno_}); promise_.set_value(
std::vector<BlockSeqno>{state_->get_seqno(), std::min<BlockSeqno>(state_->get_seqno(), shard_client_seqno_)});
td::unlink(path_).ensure(); td::unlink(path_).ensure();
} }
stop(); stop();