Line data Source code
1 : #include "fd_features.h" 2 : 3 : void 4 3 : fd_features_enable_all( fd_features_t * f ) { 5 3 : for( fd_feature_id_t const * id = fd_feature_iter_init(); 6 657 : !fd_feature_iter_done( id ); 7 654 : id = fd_feature_iter_next( id ) ) { 8 654 : fd_features_set( f, id, 0UL ); 9 654 : } 10 3 : } 11 : 12 : void 13 823386 : fd_features_disable_all( fd_features_t * f ) { 14 823386 : for( fd_feature_id_t const * id = fd_feature_iter_init(); 15 180321534 : !fd_feature_iter_done( id ); 16 179498148 : id = fd_feature_iter_next( id ) ) { 17 179498148 : fd_features_set( f, id, FD_FEATURE_DISABLED ); 18 179498148 : } 19 823386 : } 20 : 21 : void 22 407859 : fd_features_enable_cleaned_up( fd_features_t * f, uint cluster_version[3] ) { 23 407859 : for( fd_feature_id_t const * id = fd_feature_iter_init(); 24 89321121 : !fd_feature_iter_done( id ); 25 88913262 : id = fd_feature_iter_next( id ) ) { 26 88913262 : if( ( id->cleaned_up[0]<cluster_version[0] ) || 27 88913262 : ( id->cleaned_up[0]==cluster_version[0] && id->cleaned_up[1]<cluster_version[1] ) || 28 88913262 : ( id->cleaned_up[0]==cluster_version[0] && id->cleaned_up[1]==cluster_version[1] && id->cleaned_up[2]<=cluster_version[2] ) ) { 29 51390234 : fd_features_set( f, id, 0UL ); 30 51390234 : } else { 31 37523028 : fd_features_set( f, id, FD_FEATURE_DISABLED ); 32 37523028 : } 33 88913262 : } 34 407859 : } 35 : 36 : void 37 18 : fd_features_enable_one_offs( fd_features_t * f, char const * * one_offs, uint one_offs_cnt, ulong slot ) { 38 18 : uchar pubkey[32]; 39 36 : for( uint i=0U; i<one_offs_cnt; i++ ) { 40 18 : fd_base58_decode_32( one_offs[i], pubkey ); 41 18 : for( fd_feature_id_t const * id = fd_feature_iter_init(); 42 2682 : !fd_feature_iter_done( id ); 43 2682 : id = fd_feature_iter_next( id ) ) { 44 2682 : if( !memcmp( &id->id, pubkey, sizeof(fd_pubkey_t) ) ) { 45 18 : fd_features_set( f, id, slot ); 46 18 : break; 47 18 : } 48 2682 : } 49 18 : } 50 18 : }