mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1535] Don't compare pointers (#1072)
This commit is contained in:
parent
a1fa17d872
commit
afbad73c0b
@ -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++ {
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user