mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Handle adding new Tributaries
Removes last_block as an argument from Tendermint. It now loads from the DB as needed. While slightly less performant, it's easiest and should be fine.
This commit is contained in:
@@ -24,7 +24,7 @@ impl<D: Db> TributaryDb<D> {
|
||||
txn.commit();
|
||||
}
|
||||
pub fn last_block(&self, genesis: [u8; 32]) -> [u8; 32] {
|
||||
self.0.get(Self::block_key(genesis)).unwrap_or(genesis.to_vec()).try_into().unwrap()
|
||||
self.0.get(Self::block_key(genesis)).map(|last| last.try_into().unwrap()).unwrap_or(genesis)
|
||||
}
|
||||
|
||||
// This shouldn't need genesis? Yet it's saner to have then quibble about.
|
||||
|
||||
Reference in New Issue
Block a user