Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
580aec7d57 |
18
src/main.c
18
src/main.c
@@ -3052,12 +3052,7 @@ int main(int argc, char* argv[]) {
|
||||
log_error("Invalid port number");
|
||||
return 1;
|
||||
}
|
||||
// Store port in configuration system
|
||||
char port_str[16];
|
||||
snprintf(port_str, sizeof(port_str), "%d", port);
|
||||
set_database_config("relay_port", port_str, "command_line");
|
||||
// Re-apply configuration to make sure global variables are updated
|
||||
apply_configuration_to_globals();
|
||||
// Port will be stored in configuration system after it's initialized
|
||||
} else {
|
||||
log_error("Port argument requires a value");
|
||||
return 1;
|
||||
@@ -3141,6 +3136,17 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Apply command line overrides AFTER configuration system is initialized
|
||||
if (port != DEFAULT_PORT) {
|
||||
log_info("Applying port override from command line");
|
||||
printf(" Port: %d\n", port);
|
||||
char port_str[16];
|
||||
snprintf(port_str, sizeof(port_str), "%d", port);
|
||||
if (set_database_config("relay_port", port_str, "command_line") != 0) {
|
||||
log_warning("Failed to set port override in configuration");
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize NIP-11 relay information
|
||||
init_relay_info();
|
||||
|
||||
|
||||
BIN
test_combined.db
Normal file
BIN
test_combined.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user