Skip to content

Commit

Permalink
fix: add warmup allowing pullsync to commence (#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinconic authored Nov 11, 2024
1 parent 102fa58 commit 9e388ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,12 +1062,14 @@ func NewBee(
redistributionContractAddress = common.HexToAddress(o.RedistributionContractAddress)
}

redistributionContract := redistribution.New(swarmAddress, overlayEthAddress, logger, transactionService, redistributionContractAddress, abiutil.MustParseABI(chainCfg.RedistributionABI), o.TrxDebugMode)

startWarmupPeriod := time.Now()
isFullySynced := func() bool {
reserveTreshold := reserveCapacity * 5 / 10
return localStore.ReserveSize() >= reserveTreshold && pullerService.SyncRate() == 0
return localStore.ReserveSize() >= reserveTreshold && pullerService.SyncRate() == 0 && time.Now().After(startWarmupPeriod.Add(warmupTime))
}

redistributionContract := redistribution.New(swarmAddress, overlayEthAddress, logger, transactionService, redistributionContractAddress, abiutil.MustParseABI(chainCfg.RedistributionABI), o.TrxDebugMode)
agent, err = storageincentives.New(
swarmAddress,
overlayEthAddress,
Expand Down

0 comments on commit 9e388ed

Please sign in to comment.