File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use starcoin_types::{
23
23
} ,
24
24
U256 ,
25
25
} ;
26
+ use std:: str:: FromStr ;
26
27
use std:: { convert:: TryInto , sync:: Arc } ;
27
28
28
29
pub struct OpenedBlock {
@@ -296,10 +297,15 @@ impl OpenedBlock {
296
297
}
297
298
}
298
299
pub struct AddressFilter ;
300
+ static BLACKLIST : [ & str ; 2 ] = [ "0x5d3729704311db3ac10ee04d08054543" , "0xda507619aedef9755faf2111cd63d3c5" ] ;
299
301
impl AddressFilter {
300
- const BLACKLIST : Vec < AccountAddress > = vec ! [ ] ; //TODO: Fill in
301
- const ACTIVATION_BLOCK_NUMBER : BlockNumber = 16801958 ;
302
+ const ACTIVATION_BLOCK_NUMBER : BlockNumber = 10 ;
302
303
pub fn is_blacklisted ( raw_txn : & SignedUserTransaction , block_number : BlockNumber ) -> bool {
303
- block_number > Self :: ACTIVATION_BLOCK_NUMBER && Self :: BLACKLIST . contains ( & raw_txn. sender ( ) )
304
+ let blacklist: Vec < AccountAddress > = BLACKLIST
305
+ . iter ( )
306
+ . map ( |& s| AccountAddress :: from_str ( s) . expect ( "account address decode must success" ) )
307
+ . collect ( ) ;
308
+
309
+ block_number > Self :: ACTIVATION_BLOCK_NUMBER && blacklist. contains ( & raw_txn. sender ( ) )
304
310
}
305
311
}
You can’t perform that action at this time.
0 commit comments