From c3cd98cae71d4bf3b97d2802850316cc56acb37a Mon Sep 17 00:00:00 2001
From: Mark Renten <42224876+rentenmark@users.noreply.github.com>
Date: Mon, 25 Mar 2019 10:17:47 -0400
Subject: [PATCH] Add some better logging for get_outputs_by_id failure states
(#2705)
---
api/src/client.rs | 5 +++--
api/src/handlers/chain_api.rs | 10 +++++++---
core/src/pow/cuckatoo.rs | 12 ++++++------
wallet/src/libwallet/api.rs | 5 ++++-
4 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/api/src/client.rs b/api/src/client.rs
index 91d6a412d..fb3b6b476 100644
--- a/api/src/client.rs
+++ b/api/src/client.rs
@@ -203,8 +203,9 @@ fn send_request_async(req: Request
) -> Box = 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)
}
diff --git a/core/src/pow/cuckatoo.rs b/core/src/pow/cuckatoo.rs
index 0e6cba99e..e5407b298 100644
--- a/core/src/pow/cuckatoo.rs
+++ b/core/src/pow/cuckatoo.rs
@@ -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]
diff --git a/wallet/src/libwallet/api.rs b/wallet/src/libwallet/api.rs
index 5865d2214..4853021bd 100644
--- a/wallet/src/libwallet/api.rs
+++ b/wallet/src/libwallet/api.rs
@@ -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
+ }
}
}
}