Skip to content

Commit 9e388ed

Browse files
authored
fix: add warmup allowing pullsync to commence (#4898)
1 parent 102fa58 commit 9e388ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/node/node.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,12 +1062,14 @@ func NewBee(
10621062
redistributionContractAddress = common.HexToAddress(o.RedistributionContractAddress)
10631063
}
10641064

1065+
redistributionContract := redistribution.New(swarmAddress, overlayEthAddress, logger, transactionService, redistributionContractAddress, abiutil.MustParseABI(chainCfg.RedistributionABI), o.TrxDebugMode)
1066+
1067+
startWarmupPeriod := time.Now()
10651068
isFullySynced := func() bool {
10661069
reserveTreshold := reserveCapacity * 5 / 10
1067-
return localStore.ReserveSize() >= reserveTreshold && pullerService.SyncRate() == 0
1070+
return localStore.ReserveSize() >= reserveTreshold && pullerService.SyncRate() == 0 && time.Now().After(startWarmupPeriod.Add(warmupTime))
10681071
}
10691072

1070-
redistributionContract := redistribution.New(swarmAddress, overlayEthAddress, logger, transactionService, redistributionContractAddress, abiutil.MustParseABI(chainCfg.RedistributionABI), o.TrxDebugMode)
10711073
agent, err = storageincentives.New(
10721074
swarmAddress,
10731075
overlayEthAddress,

0 commit comments

Comments
 (0)