Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add Error message when sync is still in progress. #9475

Merged
merged 19 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions parity/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ usage! {


["API and Console Options – HTTP JSON-RPC"]
FLAG flag_allow_missing_blocks: (bool) = false, or |c: &Config| c.rpc.as_ref()?.allow_missing_blocks.clone(),
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved
"--allow-missing-blocks",
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved
"RPC calls will return 'null' instead of an error if ancient block sync is still in progress and the block information requested could not be found",

FLAG flag_no_jsonrpc: (bool) = false, or |c: &Config| c.rpc.as_ref()?.disable.clone(),
"--no-jsonrpc",
"Disable the HTTP JSON-RPC API server.",
Expand Down Expand Up @@ -1230,6 +1234,7 @@ struct Rpc {
keep_alive: Option<bool>,
experimental_rpcs: Option<bool>,
poll_lifetime: Option<u32>,
allow_missing_blocks: Option<bool>,
}

#[derive(Default, Debug, PartialEq, Deserialize)]
Expand Down Expand Up @@ -1697,6 +1702,7 @@ mod tests {
arg_jsonrpc_threads: 4,
arg_jsonrpc_max_payload: None,
arg_poll_lifetime: 60u32,
flag_allow_missing_blocks: false,
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved

// WS
flag_no_ws: false,
Expand Down Expand Up @@ -1973,6 +1979,7 @@ mod tests {
keep_alive: None,
experimental_rpcs: None,
poll_lifetime: None,
allow_missing_blocks: None
}),
ipc: Some(Ipc {
disable: None,
Expand Down
1 change: 1 addition & 0 deletions parity/cli/tests/config.full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ interface = "local"
cors = ["null"]
apis = ["web3", "eth", "net", "parity", "traces", "rpc", "secretstore"]
hosts = ["none"]
allow_missing_blocks = false

[websockets]
disable = false
Expand Down
2 changes: 2 additions & 0 deletions parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ impl Configuration {
miner_extras: self.miner_extras()?,
stratum: self.stratum_options()?,
update_policy: update_policy,
allow_missing_blocks: self.args.flag_allow_missing_blocks,
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved
mode: mode,
tracing: tracing,
fat_db: fat_db,
Expand Down Expand Up @@ -1390,6 +1391,7 @@ mod tests {
let args = vec!["parity"];
let conf = parse(&args);
let mut expected = RunCmd {
allow_missing_blocks: false,
cache_config: Default::default(),
dirs: Default::default(),
spec: Default::default(),
Expand Down
Loading