aboutsummaryrefslogtreecommitdiff
path: root/src/block/manager.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-23 11:47:44 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-23 11:54:40 +0100
commit07c78959480327af3709dc0e7b6c8f798cef9c92 (patch)
treefc7b53b2529449203e8953441cc14bf2c6cba5e2 /src/block/manager.rs
parent9b41f4ff2016b099ee706747828f5828f8c96b1c (diff)
downloadgarage-07c78959480327af3709dc0e7b6c8f798cef9c92.tar.gz
garage-07c78959480327af3709dc0e7b6c8f798cef9c92.zip
[refactor-block] simplify rpc_get_block
Diffstat (limited to 'src/block/manager.rs')
-rw-r--r--src/block/manager.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs
index 54290888..64e2ea27 100644
--- a/src/block/manager.rs
+++ b/src/block/manager.rs
@@ -342,9 +342,8 @@ impl BlockManager {
hash: &Hash,
order_tag: Option<OrderTag>,
) -> Result<Bytes, Error> {
- self.rpc_get_raw_block(hash, order_tag)
- .await?
- .verify_get(*hash)
+ let stream = self.rpc_get_block_streaming(hash, order_tag).await?;
+ Ok(read_stream_to_end(stream).await?.into_bytes())
}
/// Send block to nodes that should have it