From 9f7dcb68167c6cfd8d31d47e49b672dd90aa6d0a Mon Sep 17 00:00:00 2001 From: NikVolf Date: Mon, 7 Nov 2016 13:26:51 +0300 Subject: [PATCH] todo for shorter reorgs --- db/src/storage.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/db/src/storage.rs b/db/src/storage.rs index bd0e51e6..e8cdf4a0 100644 --- a/db/src/storage.rs +++ b/db/src/storage.rs @@ -410,6 +410,7 @@ impl Storage { let (at_height, route) = try!(self.fork_route(MAX_FORK_ROUTE_PRESET, hash)); // reorganization is performed only if length of side chain is at least the same as main chain + // todo: shorter chain may actualy become canonical during difficulty updates, though with rather low probability if (route.len() as i32 + 1) < (self.best_number().unwrap_or(0) as i32 - at_height as i32) { return Ok(None); }