Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_gossip_fd_active_set_private_h 2 : #define HEADER_fd_src_flamenco_gossip_fd_active_set_private_h 3 : 4 : #include "../../util/bits/fd_bits.h" 5 : 6 : static inline ulong 7 3816 : fd_active_set_stake_bucket( ulong _stake ) { 8 3816 : ulong stake = _stake / 1000000000; 9 3816 : if( FD_UNLIKELY( stake == 0UL ) ) return 0UL; 10 60 : ulong bucket = 64UL - (ulong)__builtin_clzl(stake); 11 60 : return fd_ulong_min( bucket, 24UL ); 12 3816 : } 13 : 14 : #endif /* HEADER_fd_src_flamenco_gossip_fd_active_set_private_h */