16
16
use std:: collections:: BTreeMap ;
17
17
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
18
18
use std:: sync:: mpsc:: Receiver ;
19
+ #[ cfg( test) ]
20
+ use std:: sync:: LazyLock ;
19
21
use std:: sync:: { Arc , Condvar , Mutex } ;
20
22
use std:: time:: Duration ;
21
23
22
24
use hashbrown:: { HashMap , HashSet } ;
23
- #[ cfg( test) ]
24
- use lazy_static:: lazy_static;
25
25
use libsigner:: v0:: messages:: { BlockAccepted , BlockResponse , SignerMessage as SignerMessageV0 } ;
26
26
use libsigner:: SignerEvent ;
27
27
use stacks:: burnchains:: Burnchain ;
@@ -41,11 +41,9 @@ use crate::event_dispatcher::StackerDBChannel;
41
41
use crate :: neon:: TestFlag ;
42
42
43
43
#[ cfg( test) ]
44
- lazy_static ! {
45
- /// Fault injection flag to prevent the miner from seeing enough signer signatures.
46
- /// Used to test that the signers will broadcast a block if it gets enough signatures
47
- pub static ref TEST_IGNORE_SIGNERS : TestFlag = TestFlag :: default ( ) ;
48
- }
44
+ /// Fault injection flag to prevent the miner from seeing enough signer signatures.
45
+ /// Used to test that the signers will broadcast a block if it gets enough signatures
46
+ pub static TEST_IGNORE_SIGNERS : LazyLock < TestFlag > = LazyLock :: new ( TestFlag :: default) ;
49
47
50
48
/// How long should the coordinator poll on the event receiver before
51
49
/// waking up to check timeouts?
@@ -243,7 +241,7 @@ impl StackerDBListener {
243
241
continue ;
244
242
} ;
245
243
let slot_ids = modified_slots
246
- . iter ( )
244
+ . into_iter ( )
247
245
. map ( |chunk| chunk. slot_id )
248
246
. collect :: < Vec < _ > > ( ) ;
249
247
@@ -354,7 +352,8 @@ impl StackerDBListener {
354
352
let ( lock, cvar) = & * self . blocks ;
355
353
let mut blocks = lock. lock ( ) . expect ( "FATAL: failed to lock block status" ) ;
356
354
357
- let Some ( block) = blocks. get_mut ( & rejected_data. signer_signature_hash ) else {
355
+ let Some ( block) = blocks. get_mut ( & rejected_data. signer_signature_hash )
356
+ else {
358
357
info ! (
359
358
"StackerDBListener: Received rejection for block that we did not request. Ignoring." ;
360
359
"block_signer_sighash" => %rejected_data. signer_signature_hash,
0 commit comments