Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_stakes_fd_stake_delegations_private_h 2 : #define HEADER_fd_src_flamenco_stakes_fd_stake_delegations_private_h 3 : 4 : FD_PROTOTYPES_BEGIN 5 : 6 : /* Advance to the next live (in_use), non-tombstone root pool 7 : delegation, or to the watermark if none remain. Redirects to the 8 : delta pool if there's a fork delta. Inlined for the boundary hot 9 : path. DO NOT un-inline. */ 10 : 11 : static inline void 12 2334 : fd_stake_delegations_iter_advance_private( fd_stake_delegations_iter_t * iter ) { 13 2421 : while( iter->idx<iter->wmk ) { 14 1557 : fd_stake_delegation_t * root_delegation = iter->root_pool+iter->idx; 15 1557 : if( FD_LIKELY( root_delegation->in_use ) ) { 16 1500 : fd_stake_delegation_t * ele = (root_delegation->delta_idx!=UINT_MAX) ? (iter->delta_pool+root_delegation->delta_idx) : root_delegation; 17 1500 : if( FD_LIKELY( !ele->is_tombstone ) ) { 18 1470 : iter->ele = ele; 19 1470 : return; 20 1470 : } 21 1500 : } 22 87 : iter->idx++; 23 87 : } 24 864 : iter->ele = NULL; 25 864 : } 26 : 27 : FD_PROTOTYPES_END 28 : 29 : #endif /* HEADER_fd_src_flamenco_stakes_fd_stake_delegations_private_h */