[db] Add the last_sync_time database entry
This will be used to store the height and timestamp after every sync.
This commit is contained in:
@@ -144,6 +144,9 @@ impl BatchOperations for AnyDatabase {
|
||||
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error> {
|
||||
impl_inner_method!(AnyDatabase, self, set_last_index, keychain, value)
|
||||
}
|
||||
fn set_last_sync_time(&mut self, last_sync_time: ConfirmationTime) -> Result<(), Error> {
|
||||
impl_inner_method!(AnyDatabase, self, set_last_sync_time, last_sync_time)
|
||||
}
|
||||
|
||||
fn del_script_pubkey_from_path(
|
||||
&mut self,
|
||||
@@ -180,6 +183,9 @@ impl BatchOperations for AnyDatabase {
|
||||
fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
|
||||
impl_inner_method!(AnyDatabase, self, del_last_index, keychain)
|
||||
}
|
||||
fn del_last_sync_time(&mut self) -> Result<Option<ConfirmationTime>, Error> {
|
||||
impl_inner_method!(AnyDatabase, self, del_last_sync_time)
|
||||
}
|
||||
}
|
||||
|
||||
impl Database for AnyDatabase {
|
||||
@@ -241,6 +247,9 @@ impl Database for AnyDatabase {
|
||||
fn get_last_index(&self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
|
||||
impl_inner_method!(AnyDatabase, self, get_last_index, keychain)
|
||||
}
|
||||
fn get_last_sync_time(&self) -> Result<Option<ConfirmationTime>, Error> {
|
||||
impl_inner_method!(AnyDatabase, self, get_last_sync_time)
|
||||
}
|
||||
|
||||
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error> {
|
||||
impl_inner_method!(AnyDatabase, self, increment_last_index, keychain)
|
||||
@@ -272,6 +281,9 @@ impl BatchOperations for AnyBatch {
|
||||
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error> {
|
||||
impl_inner_method!(AnyBatch, self, set_last_index, keychain, value)
|
||||
}
|
||||
fn set_last_sync_time(&mut self, last_sync_time: ConfirmationTime) -> Result<(), Error> {
|
||||
impl_inner_method!(AnyBatch, self, set_last_sync_time, last_sync_time)
|
||||
}
|
||||
|
||||
fn del_script_pubkey_from_path(
|
||||
&mut self,
|
||||
@@ -302,6 +314,9 @@ impl BatchOperations for AnyBatch {
|
||||
fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
|
||||
impl_inner_method!(AnyBatch, self, del_last_index, keychain)
|
||||
}
|
||||
fn del_last_sync_time(&mut self) -> Result<Option<ConfirmationTime>, Error> {
|
||||
impl_inner_method!(AnyBatch, self, del_last_sync_time)
|
||||
}
|
||||
}
|
||||
|
||||
impl BatchDatabase for AnyDatabase {
|
||||
|
||||
Reference in New Issue
Block a user