diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2022-05-25 09:02:27 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2022-05-25 09:02:27 +0000 |
commit | 5bb2369b5556637a92164b62e5d739034aac55ac (patch) | |
tree | 74c874f902d5148ae313ba5bf43dcfb13d6942fe /src | |
parent | Merge pull request #8349 (diff) | |
download | monero-5bb2369b5556637a92164b62e5d739034aac55ac.tar.xz |
wallet_rpc_server: add --no-initial-sync flag for quicker network binding
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 57baf428f..c55e6d84a 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -68,6 +68,7 @@ namespace const command_line::arg_descriptor<bool> arg_restricted = {"restricted-rpc", "Restricts to view-only commands", false}; const command_line::arg_descriptor<std::string> arg_wallet_dir = {"wallet-dir", "Directory for newly created wallets"}; const command_line::arg_descriptor<bool> arg_prompt_for_password = {"prompt-for-password", "Prompts for password when not provided", false}; + const command_line::arg_descriptor<bool> arg_no_initial_sync = {"no-initial-sync", "Skips the initial sync before listening for connections", false}; constexpr const char default_rpc_username[] = "monero"; @@ -4495,6 +4496,7 @@ public: const auto password_file = command_line::get_arg(vm, arg_password_file); const auto prompt_for_password = command_line::get_arg(vm, arg_prompt_for_password); const auto password_prompt = prompt_for_password ? password_prompter : nullptr; + const auto no_initial_sync = command_line::get_arg(vm, arg_no_initial_sync); if(!wallet_file.empty() && !from_json.empty()) { @@ -4563,7 +4565,8 @@ public: try { - wal->refresh(wal->is_trusted_daemon()); + if (!no_initial_sync) + wal->refresh(wal->is_trusted_daemon()); } catch (const std::exception& e) { @@ -4674,6 +4677,7 @@ int main(int argc, char** argv) { command_line::add_arg(desc_params, arg_wallet_dir); command_line::add_arg(desc_params, arg_prompt_for_password); command_line::add_arg(desc_params, arg_rpc_client_secret_key); + command_line::add_arg(desc_params, arg_no_initial_sync); daemonizer::init_options(hidden_options, desc_params); desc_params.add(hidden_options); |