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

Fix returning config from LS, add extra c7 elements in getmethods (#713)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-05-27 21:22:31 +03:00 committed by GitHub
parent 049ed0c737
commit 6b941dcceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 111 additions and 32 deletions

View file

@ -1688,13 +1688,23 @@ void LiteQuery::continue_getConfigParams(int mode, std::vector<int> param_list)
}
}
auto res = keyblk ? block::Config::extract_from_key_block(mpb.root(), mode)
: block::Config::extract_from_state(mpb.root(), mode);
if (res.is_error()) {
fatal_error(res.move_as_error());
return;
std::unique_ptr<block::Config> cfg;
if (keyblk || !(mode & block::ConfigInfo::needPrevBlocks)) {
auto res = keyblk ? block::Config::extract_from_key_block(mpb.root(), mode)
: block::Config::extract_from_state(mpb.root(), mode);
if (res.is_error()) {
fatal_error(res.move_as_error());
return;
}
cfg = res.move_as_ok();
} else {
auto res = block::ConfigInfo::extract_config(mpb.root(), mode);
if (res.is_error()) {
fatal_error(res.move_as_error());
return;
}
cfg = res.move_as_ok();
}
auto cfg = res.move_as_ok();
if (!cfg) {
fatal_error("cannot extract configuration from last mc state");
return;
@ -1707,6 +1717,9 @@ void LiteQuery::continue_getConfigParams(int mode, std::vector<int> param_list)
visit(cfg->get_config_param(i));
}
}
if (!keyblk && mode & block::ConfigInfo::needPrevBlocks) {
((block::ConfigInfo*)cfg.get())->get_prev_blocks_info();
}
} catch (vm::VmError& err) {
fatal_error("error while traversing required configuration parameters: "s + err.get_msg());
return;