mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge branch 'testnet' into accelerator
This commit is contained in:
commit
40b91d9de9
2 changed files with 7 additions and 5 deletions
|
@ -111,14 +111,16 @@ class DynamicBagOfCellsDbImpl : public DynamicBagOfCellsDb, private ExtCellCreat
|
||||||
}
|
}
|
||||||
void load_cell_async(td::Slice hash, std::shared_ptr<AsyncExecutor> executor,
|
void load_cell_async(td::Slice hash, std::shared_ptr<AsyncExecutor> executor,
|
||||||
td::Promise<Ref<DataCell>> promise) override {
|
td::Promise<Ref<DataCell>> promise) override {
|
||||||
|
auto promise_ptr = std::make_shared<td::Promise<Ref<DataCell>>>(std::move(promise));
|
||||||
auto info = hash_table_.get_if_exists(hash);
|
auto info = hash_table_.get_if_exists(hash);
|
||||||
if (info && info->sync_with_db) {
|
if (info && info->sync_with_db) {
|
||||||
TRY_RESULT_PROMISE(promise, loaded_cell, info->cell->load_cell());
|
executor->execute_async([promise = std::move(promise_ptr), cell = info->cell]() mutable {
|
||||||
promise.set_result(loaded_cell.data_cell);
|
TRY_RESULT_PROMISE((*promise), loaded_cell, cell->load_cell());
|
||||||
|
promise->set_result(loaded_cell.data_cell);
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SimpleExtCellCreator ext_cell_creator(cell_db_reader_);
|
SimpleExtCellCreator ext_cell_creator(cell_db_reader_);
|
||||||
auto promise_ptr = std::make_shared<td::Promise<Ref<DataCell>>>(std::move(promise));
|
|
||||||
executor->execute_async(
|
executor->execute_async(
|
||||||
[executor, loader = *loader_, hash = CellHash::from_slice(hash), db = this,
|
[executor, loader = *loader_, hash = CellHash::from_slice(hash), db = this,
|
||||||
ext_cell_creator = std::move(ext_cell_creator), promise = std::move(promise_ptr)]() mutable {
|
ext_cell_creator = std::move(ext_cell_creator), promise = std::move(promise_ptr)]() mutable {
|
||||||
|
|
|
@ -47,8 +47,8 @@ endif()
|
||||||
if (USE_EMSCRIPTEN)
|
if (USE_EMSCRIPTEN)
|
||||||
add_executable(emulator-emscripten ${EMULATOR_EMSCRIPTEN_SOURCE})
|
add_executable(emulator-emscripten ${EMULATOR_EMSCRIPTEN_SOURCE})
|
||||||
target_link_libraries(emulator-emscripten PUBLIC emulator)
|
target_link_libraries(emulator-emscripten PUBLIC emulator)
|
||||||
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_RUNTIME_METHODS=_malloc,free,UTF8ToString,stringToUTF8,allocate,ALLOC_NORMAL,lengthBytesUTF8)
|
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_RUNTIME_METHODS=UTF8ToString,stringToUTF8,allocate,ALLOC_NORMAL,lengthBytesUTF8)
|
||||||
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_FUNCTIONS=_emulate,_free,_run_get_method,_create_emulator,_destroy_emulator,_emulate_with_emulator,_version)
|
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_FUNCTIONS=_emulate,_free,_malloc,_run_get_method,_create_emulator,_destroy_emulator,_emulate_with_emulator,_version)
|
||||||
target_link_options(emulator-emscripten PRIVATE -sEXPORT_NAME=EmulatorModule)
|
target_link_options(emulator-emscripten PRIVATE -sEXPORT_NAME=EmulatorModule)
|
||||||
target_link_options(emulator-emscripten PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
|
target_link_options(emulator-emscripten PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
|
||||||
target_link_options(emulator-emscripten PRIVATE -Oz)
|
target_link_options(emulator-emscripten PRIVATE -Oz)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue