Add option to join by common parents
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
c8fe21c1ef
commit
580a2f4dc6
@ -2,6 +2,7 @@ package chain
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -12,6 +13,14 @@ import (
|
|||||||
|
|
||||||
const BootstrapPeerThreshold = 2
|
const BootstrapPeerThreshold = 2
|
||||||
|
|
||||||
|
var coalesceForksParents = false
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
if os.Getenv("LOTUS_SYNC_REL_PARENT") == "yes" {
|
||||||
|
coalesceForksParents = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BSStateInit = 0
|
BSStateInit = 0
|
||||||
BSStateSelected = 1
|
BSStateSelected = 1
|
||||||
@ -256,6 +265,9 @@ func (stb *syncTargetBucket) sameChainAs(ts *types.TipSet) bool {
|
|||||||
if ts.Parents() == t.Key() {
|
if ts.Parents() == t.Key() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if coalesceForksParents && ts.Parents() == t.Parents() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user