[wallet] Add an option to change the assumed current height

This commit is contained in:
Alekos Filini
2020-05-06 17:17:14 +02:00
parent 45aa001e10
commit e32559a06a
4 changed files with 61 additions and 12 deletions

View File

@@ -29,6 +29,10 @@ impl<T: Read + Write> Blockchain for ElectrumBlockchain<T> {
fn offline() -> Self {
ElectrumBlockchain(None)
}
fn is_online(&self) -> bool {
self.0.is_some()
}
}
impl<T: Read + Write> OnlineBlockchain for ElectrumBlockchain<T> {
@@ -190,6 +194,8 @@ impl<T: Read + Write> OnlineBlockchain for ElectrumBlockchain<T> {
}
fn get_height(&mut self) -> Result<usize, Error> {
// TODO: unsubscribe when added to the client, or is there a better call to use here?
Ok(self
.0
.as_mut()