@@ -243,13 +243,21 @@ void *fd_stake_history_entry_generate( void *mem, void **alloc_mem, fd_rng_t * r
243
243
fd_stake_history_entry_t * self = (fd_stake_history_entry_t * ) mem ;
244
244
* alloc_mem = (uchar * ) * alloc_mem + sizeof (fd_stake_history_entry_t );
245
245
fd_stake_history_entry_new (mem );
246
- self -> epoch = fd_rng_ulong ( rng );
247
246
self -> effective = fd_rng_ulong ( rng );
248
247
self -> activating = fd_rng_ulong ( rng );
249
248
self -> deactivating = fd_rng_ulong ( rng );
250
249
return mem ;
251
250
}
252
251
252
+ void * fd_epoch_stake_history_entry_pair_generate ( void * mem , void * * alloc_mem , fd_rng_t * rng ) {
253
+ fd_epoch_stake_history_entry_pair_t * self = (fd_epoch_stake_history_entry_pair_t * ) mem ;
254
+ * alloc_mem = (uchar * ) * alloc_mem + sizeof (fd_epoch_stake_history_entry_pair_t );
255
+ fd_epoch_stake_history_entry_pair_new (mem );
256
+ self -> epoch = fd_rng_ulong ( rng );
257
+ fd_stake_history_entry_generate ( & self -> entry , alloc_mem , rng );
258
+ return mem ;
259
+ }
260
+
253
261
void * fd_stake_history_generate ( void * mem , void * * alloc_mem , fd_rng_t * rng ) {
254
262
fd_stake_history_t * self = (fd_stake_history_t * ) mem ;
255
263
* alloc_mem = (uchar * ) * alloc_mem + sizeof (fd_stake_history_t );
@@ -258,7 +266,7 @@ void *fd_stake_history_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
258
266
self -> fd_stake_history_size = 512 ;
259
267
self -> fd_stake_history_offset = 0 ;
260
268
for ( ulong i = 0 ; i < self -> fd_stake_history_len ; i ++ ) {
261
- fd_stake_history_entry_generate ( self -> fd_stake_history + i , alloc_mem , rng );
269
+ fd_epoch_stake_history_entry_pair_generate ( self -> fd_stake_history + i , alloc_mem , rng );
262
270
}
263
271
return mem ;
264
272
}
0 commit comments