projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expose `confirmations` via `ChannelDetails`
[rust-lightning]
/
lightning-block-sync
/
src
/
rpc.rs
diff --git
a/lightning-block-sync/src/rpc.rs
b/lightning-block-sync/src/rpc.rs
index 1e0aa9d93fc45e9113c8a78ff2c545e551df50ba..f04769560246f8537e1e022efa22c8b7a815eab4 100644
(file)
--- a/
lightning-block-sync/src/rpc.rs
+++ b/
lightning-block-sync/src/rpc.rs
@@
-1,14
+1,13
@@
//! Simple RPC client implementation which implements [`BlockSource`] against a Bitcoin Core RPC
//! endpoint.
//! Simple RPC client implementation which implements [`BlockSource`] against a Bitcoin Core RPC
//! endpoint.
-use crate::{BlockHeaderData, BlockSource, AsyncBlockSourceResult};
+use crate::{Block
Data, Block
HeaderData, BlockSource, AsyncBlockSourceResult};
use crate::http::{HttpClient, HttpEndpoint, HttpError, JsonResponse};
use crate::http::{HttpClient, HttpEndpoint, HttpError, JsonResponse};
-use bitcoin::blockdata::block::Block;
use bitcoin::hash_types::BlockHash;
use bitcoin::hashes::hex::ToHex;
use bitcoin::hash_types::BlockHash;
use bitcoin::hashes::hex::ToHex;
-use futures::lock::Mutex;
+use futures
_util
::lock::Mutex;
use serde_json;
use serde_json;
@@
-91,11
+90,11
@@
impl BlockSource for RpcClient {
})
}
})
}
- fn get_block<'a>(&'a self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, Block> {
+ fn get_block<'a>(&'a self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, Block
Data
> {
Box::pin(async move {
let header_hash = serde_json::json!(header_hash.to_hex());
let verbosity = serde_json::json!(0);
Box::pin(async move {
let header_hash = serde_json::json!(header_hash.to_hex());
let verbosity = serde_json::json!(0);
- Ok(
self.call_method("getblock", &[header_hash, verbosity]).await?
)
+ Ok(
BlockData::FullBlock(self.call_method("getblock", &[header_hash, verbosity]).await?)
)
})
}
})
}