Skip to content

Commit c7a317b

Browse files
feat: Dont use ntp servers when Thirdparty services are disabled
1 parent 693634b commit c7a317b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

node/get_status_node.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ var (
6666
ErrNoRunningNode = errors.New("there is no running node")
6767
)
6868

69-
// FIXME: This is temporal and will be replaced with the actual setting
70-
const privateMode = false
71-
7269
// StatusNode abstracts contained geth node and provides helper methods to
7370
// interact with it.
7471
type StatusNode struct {

node/status_node_services.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,18 @@ func (b *StatusNode) personalService() *personal.Service {
411411
}
412412

413413
func (b *StatusNode) TimeSource() timesource.Provider {
414+
accDB, err := accounts.NewDB(b.appDB)
415+
if err != nil {
416+
b.logger.Error("failed to get if thirdparty services are enabled", zap.Error(err))
417+
return nil
418+
}
414419
if b.timeSourceSrvc == nil {
415-
if privateMode {
420+
thirdpartyServicesEnabled, err := accDB.ThirdpartyServicesEnabled()
421+
if err != nil {
422+
b.logger.Error("failed to get if thirdparty services are enabled", zap.Error(err))
423+
return nil
424+
}
425+
if thirdpartyServicesEnabled {
416426
b.timeSourceSrvc = timesource.LocalService()
417427
} else {
418428
b.timeSourceSrvc = timesource.DefaultService()

0 commit comments

Comments
 (0)