Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,18 @@ fd_sysvar_epoch_schedule_write( fd_bank_t * bank,
fd_funk_txn_xid_t const * xid,
fd_capture_ctx_t * capture_ctx,
fd_epoch_schedule_t const * epoch_schedule ) {
ulong sz = fd_epoch_schedule_size( epoch_schedule );
/* TODO remove alloca */
uchar enc[ sz ];
memset( enc, 0, sz );

uchar enc[ FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ ] = {0};

fd_bincode_encode_ctx_t ctx = {
.data = enc,
.dataend = enc + sz
.dataend = enc + FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ
};
if( fd_epoch_schedule_encode( epoch_schedule, &ctx ) ) {
FD_LOG_ERR(("fd_epoch_schedule_encode failed"));
if( FD_UNLIKELY( fd_epoch_schedule_encode( epoch_schedule, &ctx ) ) ) {
FD_LOG_ERR(( "fd_epoch_schedule_encode failed" ));
}

fd_sysvar_account_update( bank, accdb, xid, capture_ctx, &fd_sysvar_epoch_schedule_id, enc, sz );
fd_sysvar_account_update( bank, accdb, xid, capture_ctx, &fd_sysvar_epoch_schedule_id, enc, FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ );
}

fd_epoch_schedule_t *
Expand Down
Loading