diff --git a/domain/consensus/processes/reachabilitymanager/reachability_external_test.go b/domain/consensus/processes/reachabilitymanager/reachability_external_test.go index c5b5edd35..cdd97593c 100644 --- a/domain/consensus/processes/reachabilitymanager/reachability_external_test.go +++ b/domain/consensus/processes/reachabilitymanager/reachability_external_test.go @@ -234,12 +234,12 @@ func TestReindexIntervalsEarlierThanReindexRoot(t *testing.T) { // Each addition will trigger a low-than-reindex-root reindex. We // expect the centerInterval to shrink by 1 each time, but its child // to remain unaffected - cetnerData, err := tc.ReachabilityDataStore().ReachabilityData(tc.DatabaseContext(), centerBlock) + centerData, err := tc.ReachabilityDataStore().ReachabilityData(tc.DatabaseContext(), centerBlock) if err != nil { t.Fatalf("ReachabilityData: %s", err) } - treeChildOfCenterBlock := cetnerData.TreeNode.Children[0] + treeChildOfCenterBlock := centerData.TreeNode.Children[0] treeChildOfCenterBlockOriginalIntervalSize := intervalSize(treeChildOfCenterBlock) leftTipHash := leftBlock for i := uint64(0); i < reachabilityReindexWindow-1; i++ { diff --git a/domain/consensus/processes/reachabilitymanager/tree.go b/domain/consensus/processes/reachabilitymanager/tree.go index b531aae3a..8ea711939 100644 --- a/domain/consensus/processes/reachabilitymanager/tree.go +++ b/domain/consensus/processes/reachabilitymanager/tree.go @@ -317,7 +317,7 @@ func (rt *reachabilityManager) countSubtrees(node *externalapi.DomainHash, subTr // We reached a leaf or a pre-calculated subtree. // Push information up - for current != node { + for *current != *node { current, err = rt.parent(current) if err != nil { return err @@ -471,7 +471,7 @@ func (rt *reachabilityManager) reclaimIntervalBeforeChosenChild(rtn, commonAnces } } - if current == reindexRoot { + if *current == *reindexRoot { // "Deallocate" an interval of slackReachabilityIntervalForReclaiming // from this node. This is the interval that we'll use for the new // node. @@ -505,7 +505,7 @@ func (rt *reachabilityManager) reclaimIntervalBeforeChosenChild(rtn, commonAnces // current node with an interval that is smaller by // slackReachabilityIntervalForReclaiming. This is to make room // for the new node. - for current != commonAncestor { + for *current != *commonAncestor { currentInterval, err := rt.interval(current) if err != nil { return err @@ -593,7 +593,7 @@ func (rt *reachabilityManager) reclaimIntervalAfterChosenChild(node, commonAnces } } - if current == reindexRoot { + if *current == *reindexRoot { // "Deallocate" an interval of slackReachabilityIntervalForReclaiming // from this node. This is the interval that we'll use for the new // node.