File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -333,13 +333,23 @@ func (ct *ClaimTrie) ResetHeight(height int32) error {
333
333
if passedHashFork {
334
334
names = nil // force them to reconsider all names
335
335
}
336
+
337
+ var fullRebuildRequired bool
338
+
336
339
err = ct .merkleTrie .SetRoot (hash )
337
340
if err == merkletrie .ErrFullRebuildRequired {
341
+ fullRebuildRequired = true
342
+ } else if err != nil {
343
+ return errors .Wrapf (err , "setRoot" )
344
+ }
345
+
346
+ if fullRebuildRequired {
338
347
ct .runFullTrieRebuild (names , nil )
339
348
}
340
349
341
350
if ! ct .MerkleHash ().IsEqual (hash ) {
342
- return errors .Errorf ("unable to restore the hash at height %d" , height )
351
+ return errors .Errorf ("unable to restore the hash at height %d" +
352
+ " (fullTriedRebuilt: %t)" , height , fullRebuildRequired )
343
353
}
344
354
345
355
return errors .WithStack (ct .blockRepo .Delete (height + 1 , oldHeight ))
You can’t perform that action at this time.
0 commit comments