Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Oct 17, 2024
1 parent f582712 commit c50a0c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
22 changes: 6 additions & 16 deletions cmd/rpcdaemon/cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ import (
"google.golang.org/grpc/health/grpc_health_v1"

"github.com/erigontech/erigon-lib/chain"
"github.com/erigontech/erigon-lib/chain/snapcfg"
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/datadir"
"github.com/erigontech/erigon-lib/common/hexutility"
"github.com/erigontech/erigon-lib/config3"
"github.com/erigontech/erigon-lib/direct"
"github.com/erigontech/erigon-lib/downloader/downloadercfg"
"github.com/erigontech/erigon-lib/downloader/downloaderrawdb"
"github.com/erigontech/erigon-lib/gointerfaces"
"github.com/erigontech/erigon-lib/gointerfaces/grpcutil"
Expand Down Expand Up @@ -407,20 +405,12 @@ func RemoteServices(ctx context.Context, cfg *httpcfg.HttpCfg, logger log.Logger
return nil, nil, nil, nil, nil, nil, nil, ff, nil, nil, errors.New("chain config not found in db. Need start erigon at least once on this db")
}

allSegmentsDownloadComplete := false
{
snapcfg.LoadRemotePreverified()
if preverifiedCfg := downloadercfg.ReadPreverifiedToml(cfg.Dirs, cc.ChainName); preverifiedCfg != nil {
allSegmentsDownloadComplete, err = downloaderrawdb.AllSegmentsDownloadCompleteFlag(cfg.Dirs)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, err
}
if !allSegmentsDownloadComplete {
log.Warn("[rpc] download of segments not complete yet (need wait, then RPC will work)")
}
} else {
log.Warn("[rpc] download of segments not complete yet")
}
allSegmentsDownloadComplete, err := downloaderrawdb.AllSegmentsDownloadCompleteFlag(cfg.Dirs)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, err
}
if !allSegmentsDownloadComplete {
log.Warn("[rpc] download of segments not complete yet (need wait, then RPC will work)")
}

// Configure sapshots
Expand Down
3 changes: 1 addition & 2 deletions erigon-lib/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2295,8 +2295,7 @@ func (d *Downloader) ReCalcStats(interval time.Duration) {

if stats.Completed {
logger.Warn("[dbg] completed", "completed", stats.Completed, "len", len(torrents))
//d.save()
//d.writeCompletionMarker()
d.saveAllCompleteFlag()
}

if !stats.Completed {
Expand Down

0 comments on commit c50a0c9

Please sign in to comment.