mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
put_block modification
This commit is contained in:
parent
0674349de9
commit
ffc37debb4
@ -31,6 +31,6 @@ impl SequecerBlockStore {
|
||||
}
|
||||
|
||||
pub fn put_block_at_id(&self, block: Block) -> Result<()> {
|
||||
Ok(self.dbio.put_block(block)?)
|
||||
Ok(self.dbio.put_block(block, false)?)
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ impl RocksDBIO {
|
||||
)
|
||||
.map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?;
|
||||
|
||||
self.put_block(block)?;
|
||||
self.put_block(block, true)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -173,13 +173,15 @@ impl RocksDBIO {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn put_block(&self, block: Block) -> DbResult<()> {
|
||||
pub fn put_block(&self, block: Block, first: bool) -> DbResult<()> {
|
||||
let cf_block = self.block_column();
|
||||
|
||||
if !first {
|
||||
let last_curr_block = self.get_meta_last_block_in_db()?;
|
||||
|
||||
if block.block_id > last_curr_block {
|
||||
self.put_meta_last_block_in_db(block.block_id)?;
|
||||
}
|
||||
}
|
||||
|
||||
self.db
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user