Skip to content

Commit 0f0117c

Browse files
authored
unsave block body (starcoinorg#2995)
unsave block body
1 parent 54b2537 commit 0f0117c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

storage/src/block/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,12 @@ impl BlockStorage {
180180
}
181181

182182
pub fn commit_block(&self, block: Block) -> Result<()> {
183-
let (header, body) = block.clone().into_inner();
183+
let (header, _) = block.clone().into_inner();
184184
//save header
185-
let block_id = header.id();
186185
self.save_header(header)?;
187-
//save body
188-
self.save_body(block_id, body)?;
189-
//save block cache
186+
// save block , no need body
187+
// self.save_body(block_id, body)?;
188+
//save block
190189
self.save(block)
191190
}
192191
pub fn delete_block(&self, block_id: HashValue) -> Result<()> {

storage/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ impl BlockStore for Storage {
295295
self.block_storage.get_blocks(ids)
296296
}
297297

298+
#[allow(deprecated)]
298299
fn get_body(&self, block_id: HashValue) -> Result<Option<BlockBody>> {
299300
self.block_storage.get_body(block_id)
300301
}

0 commit comments

Comments
 (0)