Skip to content

Commit 372638d

Browse files
committed
Appease the linter
1 parent de200a1 commit 372638d

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

cmd/stellar-rpc/internal/config/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ type Config struct {
1818
CaptiveCoreStoragePath string
1919
StellarCoreBinaryPath string
2020
CaptiveCoreConfigPath string
21-
CaptiveCoreHTTPPort uint
22-
CaptiveCoreHTTPQueryPort uint
23-
CaptiveCoreHTTPQueryThreadPoolSize uint
24-
CaptiveCoreHTTPQuerySnapshotLedgers uint
21+
CaptiveCoreHTTPPort uint16
22+
CaptiveCoreHTTPQueryPort uint16
23+
CaptiveCoreHTTPQueryThreadPoolSize uint16
24+
CaptiveCoreHTTPQuerySnapshotLedgers uint16
2525

2626
Endpoint string
2727
AdminEndpoint string

cmd/stellar-rpc/internal/config/options.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,25 @@ func (cfg *Config) options() Options {
8686
Name: "stellar-captive-core-http-port",
8787
Usage: "HTTP port for Captive Core to listen on (0 disables the HTTP server)",
8888
ConfigKey: &cfg.CaptiveCoreHTTPPort,
89-
DefaultValue: uint(defaultCaptiveCoreHTTPPort),
89+
DefaultValue: uint16(defaultCaptiveCoreHTTPPort),
9090
},
9191
{
9292
Name: "stellar-captive-core-http-query-port",
9393
Usage: "HTTP port for Captive Core to listen on for high-performance queries like /getledgerentry (0 disables the HTTP server, must not conflict with CAPTIVE_CORE_HTTP_PORT)",
9494
ConfigKey: &cfg.CaptiveCoreHTTPQueryPort,
95-
DefaultValue: uint(0), // Disabled by default, although it normally uses 11628
95+
DefaultValue: uint16(0), // Disabled by default, although it normally uses 11628
9696
},
9797
{
9898
Name: "stellar-captive-core-http-query-thread-pool-size",
9999
Usage: "Number of threads to use by Captive Core's high-performance query server",
100100
ConfigKey: &cfg.CaptiveCoreHTTPQueryThreadPoolSize,
101-
DefaultValue: uint(runtime.NumCPU()), //nolint:gosec
101+
DefaultValue: uint16(runtime.NumCPU()), //nolint:gosec
102102
},
103103
{
104104
Name: "stellar-captive-core-http-query-snapshot-ledgers",
105105
Usage: "Size of ledger history in Captive Core's high-performance query server (don't touch unless you know what you are doing)",
106106
ConfigKey: &cfg.CaptiveCoreHTTPQuerySnapshotLedgers,
107-
DefaultValue: uint(4),
107+
DefaultValue: uint16(4),
108108
},
109109
{
110110
Name: "log-level",

cmd/stellar-rpc/internal/daemon/daemon.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,15 @@ func newCaptiveCore(cfg *config.Config, logger *supportlog.Entry) (*ledgerbacken
126126
if cfg.CaptiveCoreHTTPQueryPort != 0 {
127127
// Only try to enable the server if the port passed is non-zero
128128
queryServerParams = &ledgerbackend.HTTPQueryServerParams{
129-
Port: uint16(cfg.CaptiveCoreHTTPQueryPort),
130-
ThreadPoolSize: uint16(cfg.CaptiveCoreHTTPQueryThreadPoolSize),
131-
SnapshotLedgers: uint16(cfg.CaptiveCoreHTTPQuerySnapshotLedgers),
129+
Port: cfg.CaptiveCoreHTTPQueryPort,
130+
ThreadPoolSize: cfg.CaptiveCoreHTTPQueryThreadPoolSize,
131+
SnapshotLedgers: cfg.CaptiveCoreHTTPQuerySnapshotLedgers,
132132
}
133133
}
134134

135+
httpPort := uint(cfg.CaptiveCoreHTTPQueryPort)
135136
captiveCoreTomlParams := ledgerbackend.CaptiveCoreTomlParams{
136-
HTTPPort: &cfg.CaptiveCoreHTTPPort,
137+
HTTPPort: &httpPort,
137138
HistoryArchiveURLs: cfg.HistoryArchiveURLs,
138139
NetworkPassphrase: cfg.NetworkPassphrase,
139140
Strict: true,

0 commit comments

Comments
 (0)