projects
/
ldk-sample
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check that the node we connect to matches the user-provided chain
[ldk-sample]
/
src
/
convert.rs
diff --git
a/src/convert.rs
b/src/convert.rs
index 7dbd8cceb13caca3938a35077f205b1ff96aa386..a652980e3ddbd9a20e6cbf5e54092938a1ffb5ac 100644
(file)
--- a/
src/convert.rs
+++ b/
src/convert.rs
@@
-72,6
+72,7
@@
impl TryInto<FeeResponse> for JsonResponse {
pub struct BlockchainInfo {
pub latest_height: usize,
pub latest_blockhash: BlockHash,
pub struct BlockchainInfo {
pub latest_height: usize,
pub latest_blockhash: BlockHash,
+ pub chain: String,
}
impl TryInto<BlockchainInfo> for JsonResponse {
}
impl TryInto<BlockchainInfo> for JsonResponse {
@@
-81,6
+82,7
@@
impl TryInto<BlockchainInfo> for JsonResponse {
latest_height: self.0["blocks"].as_u64().unwrap() as usize,
latest_blockhash: BlockHash::from_hex(self.0["bestblockhash"].as_str().unwrap())
.unwrap(),
latest_height: self.0["blocks"].as_u64().unwrap() as usize,
latest_blockhash: BlockHash::from_hex(self.0["bestblockhash"].as_str().unwrap())
.unwrap(),
+ chain: self.0["chain"].as_str().unwrap().to_string(),
})
}
}
})
}
}