Skip to content

Commit

Permalink
Add some better logging for get_outputs_by_id failure states (#2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentenmark authored and hashmap committed Mar 25, 2019
1 parent 3566da2 commit c3cd98c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
5 changes: 3 additions & 2 deletions api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ fn send_request_async(req: Request<Body>) -> Box<dyn Future<Item = String, Error
.and_then(|resp| {
if !resp.status().is_success() {
Either::A(err(ErrorKind::RequestError(format!(
"Wrong response code: {}",
resp.status()
"Wrong response code: {} with data {:?}",
resp.status(),
resp.body()
))
.into()))
} else {
Expand Down
10 changes: 7 additions & 3 deletions api/src/handlers/chain_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ impl OutputHandler {

let mut outputs: Vec<Output> = vec![];
for x in commitments {
if let Ok(output) = self.get_output(&x) {
outputs.push(output);
}
match self.get_output(&x) {
Ok(output) => outputs.push(output),
Err(e) => error!(
"Failure to get output for commitment {} with error {}",
x, e
),
};
}
Ok(outputs)
}
Expand Down
12 changes: 6 additions & 6 deletions core/src/pow/cuckatoo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ mod test {

// Cuckatoo 31 Solution for Header [0u8;80] - nonce 99
static V1_31: [u64; 42] = [
0x1128e07, 0xc181131, 0x110fad36, 0x1135ddee, 0x1669c7d3, 0x1931e6ea, 0x1c0005f3, 0x1dd6ecca,
0x1e29ce7e, 0x209736fc, 0x2692bf1a, 0x27b85aa9, 0x29bb7693, 0x2dc2a047, 0x2e28650a, 0x2f381195,
0x350eb3f9, 0x3beed728, 0x3e861cbc, 0x41448cc1, 0x41f08f6d, 0x42fbc48a, 0x4383ab31, 0x4389c61f,
0x4540a5ce, 0x49a17405, 0x50372ded, 0x512f0db0, 0x588b6288, 0x5a36aa46, 0x5c29e1fe, 0x6118ab16,
0x634705b5, 0x6633d190, 0x6683782f, 0x6728b6e1, 0x67adfb45, 0x68ae2306, 0x6d60f5e1, 0x78af3c4f,
0x7dde51ab, 0x7faced21
0x1128e07, 0xc181131, 0x110fad36, 0x1135ddee, 0x1669c7d3, 0x1931e6ea, 0x1c0005f3,
0x1dd6ecca, 0x1e29ce7e, 0x209736fc, 0x2692bf1a, 0x27b85aa9, 0x29bb7693, 0x2dc2a047,
0x2e28650a, 0x2f381195, 0x350eb3f9, 0x3beed728, 0x3e861cbc, 0x41448cc1, 0x41f08f6d,
0x42fbc48a, 0x4383ab31, 0x4389c61f, 0x4540a5ce, 0x49a17405, 0x50372ded, 0x512f0db0,
0x588b6288, 0x5a36aa46, 0x5c29e1fe, 0x6118ab16, 0x634705b5, 0x6633d190, 0x6683782f,
0x6728b6e1, 0x67adfb45, 0x68ae2306, 0x6d60f5e1, 0x78af3c4f, 0x7dde51ab, 0x7faced21,
];

#[test]
Expand Down
5 changes: 4 additions & 1 deletion wallet/src/libwallet/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,10 @@ where
let parent_key_id = w.parent_key_id();
match updater::refresh_outputs(&mut *w, &parent_key_id, update_all) {
Ok(_) => true,
Err(_) => false,
Err(e) => {
error!("failed to refresh outputs for wallet with error : {:?}", e);
false
}
}
}
}
Expand Down

0 comments on commit c3cd98c

Please sign in to comment.