Store and use last scanned PMMR height in check_repair (#246)

* store last scanned PMMR check index

* rustfmt

* fix issue where account names will be overwritten on check_repair

* rustfmt

* attempts to include check_repair scan as part of normal update

* rustfmt

* fix error on restore due to incorrect parent key id being set

* addition of calls to heigt_range_to_pmmr_indices traits and implementations

* rustfmt

* get_chain_height -> get_chain_tip

* rustfmt

* retrieve height+hash from node, modify check_repair to use block heights

* rustfmt

* fixes from live testing

* rustfmt

* test cleanup and change dependencies back to grin master

* rustfmt
This commit is contained in:
Yeastplume
2019-11-04 21:10:05 +00:00
committed by GitHub
parent ba6c5ed0f8
commit c518f35c8d
16 changed files with 855 additions and 358 deletions
+7 -1
View File
@@ -1232,7 +1232,13 @@ where
let w = w_lock.lc_provider()?.wallet_inst()?;
// Test keychain mask, to keep API consistent
let _ = w.keychain(keychain_mask)?;
owner::node_height(&mut **w, keychain_mask)
let mut res = owner::node_height(&mut **w, keychain_mask)?;
if self.doctest_mode {
// return a consistent hash for doctest
res.header_hash =
"d4b3d3c40695afd8c7760f8fc423565f7d41310b7a4e1c4a4a7950a66f16240d".to_owned();
}
Ok(res)
}
// LIFECYCLE FUNCTIONS
+1
View File
@@ -1239,6 +1239,7 @@ pub trait OwnerRpc: Sync + Send {
"jsonrpc": "2.0",
"result": {
"Ok": {
"header_hash": "d4b3d3c40695afd8c7760f8fc423565f7d41310b7a4e1c4a4a7950a66f16240d",
"height": "5",
"updated_from_node": true
}
+1
View File
@@ -1304,6 +1304,7 @@ pub trait OwnerRpcS {
"jsonrpc": "2.0",
"result": {
"Ok": {
"header_hash": "d4b3d3c40695afd8c7760f8fc423565f7d41310b7a4e1c4a4a7950a66f16240d",
"height": "5",
"updated_from_node": true
}