Skip to content

Commit 3c92a83

Browse files
riptlripatel-fd
authored andcommitted
Simplify fdctl_cfg_from_env
1 parent a9786b6 commit 3c92a83

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/app/shared/fd_config.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,24 +209,9 @@ fdctl_cfg_from_env( int * pargc,
209209
config_t * config ) {
210210

211211
memset( config, 0, sizeof(config_t) );
212-
#if FD_HAS_NO_AGAVE
213-
static uchar pod_mem1[ FD_TOML_POD_SZ ];
214-
static uchar pod_mem2[ FD_TOML_POD_SZ ];
215-
uchar * pod1 = fd_pod_join( fd_pod_new( pod_mem1, sizeof(pod_mem1) ) );
216-
uchar * pod2 = fd_pod_join( fd_pod_new( pod_mem2, sizeof(pod_mem2) ) );
217-
218-
uchar scratch[ 4096 ];
219-
int toml_err = fd_toml_parse( fdctl_default_config, fdctl_default_config_sz, pod1, scratch, sizeof(scratch), NULL );
220-
if( FD_UNLIKELY( toml_err!=FD_TOML_SUCCESS ) ) FD_LOG_ERR(( "Invalid config (%s)", "default.toml" ));
221-
toml_err = fd_toml_parse( fdctl_default_firedancer_config, fdctl_default_firedancer_config_sz, pod2, scratch, sizeof(scratch), NULL );
222-
if( FD_UNLIKELY( toml_err!=FD_TOML_SUCCESS ) ) FD_LOG_ERR(( "Invalid config (%s)", "default-firedancer.toml" ));
223-
224-
if( FD_UNLIKELY( !fdctl_pod_to_cfg( config, pod1 ) ) ) FD_LOG_ERR(( "Invalid config (%s)", "default.toml" ));
225-
if( FD_UNLIKELY( !fdctl_pod_to_cfg( config, pod2 ) ) ) FD_LOG_ERR(( "Invalid config (%s)", "default-firedancer.toml" ));
226-
fd_pod_delete( fd_pod_leave( pod1 ) );
227-
fd_pod_delete( fd_pod_leave( pod2 ) );
228-
#else
229212
fdctl_cfg_load_buf( config, (char const *)fdctl_default_config, fdctl_default_config_sz, "default" );
213+
#if FD_HAS_NO_AGAVE
214+
fdctl_cfg_load_buf( config, (char const *)fdctl_default_firedancer_config, fdctl_default_firedancer_config_sz, "default_firedancer" );
230215
#endif
231216

232217
const char * user_config = fd_env_strip_cmdline_cstr(

0 commit comments

Comments
 (0)