Add rescan command

This commit is contained in:
Aditya Kulkarni
2019-09-12 20:32:47 -07:00
parent fedd238343
commit d71e37152b
3 changed files with 46 additions and 4 deletions

View File

@@ -574,6 +574,16 @@ impl LightWallet {
Ok(())
}
// Clears all the downloaded blocks and resets the state back to the inital block.
// After this, the wallet's initial state will need to be set
// and the wallet will need to be rescanned
pub fn clear_blocks(&self) {
self.blocks.write().unwrap().clear();
self.txs.write().unwrap().clear();
}
pub fn set_initial_block(&self, height: i32, hash: &str, sapling_tree: &str) -> bool {
let mut blocks = self.blocks.write().unwrap();
if !blocks.is_empty() {