Skip to content

Commit

Permalink
GH-985 chain is not available until after initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Nov 1, 2024
1 parent f8f327c commit 8012d03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions programs/nodeos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ int main(int argc, char** argv)
uint32_t short_hash = 0;
fc::from_hex(eosio::version::version_hash(), (char*)&short_hash, sizeof(short_hash));

app->set_stop_executor_cb([&app]() {
ilog("appbase quit called");
app->get_io_context().stop();
auto& chain = app->get_plugin<chain_plugin>().chain();
chain.interrupt_transaction();
});
app->set_version(htonl(short_hash));
app->set_version_string(eosio::version::version_client());
app->set_full_version_string(eosio::version::version_full());
Expand All @@ -194,6 +188,12 @@ int main(int argc, char** argv)
}
return INITIALIZE_FAIL;
}
controller& chain = app->get_plugin<chain_plugin>().chain();
app->set_stop_executor_cb([&app, &chain]() {
ilog("appbase quit called");
chain.interrupt_transaction();
app->get_io_context().stop();
});
if (auto resmon_plugin = app->find_plugin<resource_monitor_plugin>()) {
resmon_plugin->monitor_directory(app->data_dir());
} else {
Expand Down

0 comments on commit 8012d03

Please sign in to comment.