@@ -71,10 +71,7 @@ impl SharedMasternodeState {
7171
7272 /// Check if the masternode engine is available (sync has completed at least once).
7373 pub fn is_available ( & self ) -> bool {
74- self . engine
75- . read ( )
76- . map ( |guard| guard. is_some ( ) )
77- . unwrap_or ( false )
74+ self . engine . read ( ) . map ( |guard| guard. is_some ( ) ) . unwrap_or ( false )
7875 }
7976
8077 /// Get the masternode list at a specific block height (synchronous).
@@ -106,9 +103,10 @@ impl SharedMasternodeState {
106103 quorum_type : LLMQType ,
107104 quorum_hash : QuorumHash ,
108105 ) -> Result < QualifiedQuorumEntry , SpvError > {
109- let guard = self . engine . read ( ) . map_err ( |_| {
110- SpvError :: QuorumLookupError ( "Lock poisoned" . to_string ( ) )
111- } ) ?;
106+ let guard = self
107+ . engine
108+ . read ( )
109+ . map_err ( |_| SpvError :: QuorumLookupError ( "Lock poisoned" . to_string ( ) ) ) ?;
112110
113111 let engine = guard. as_ref ( ) . ok_or_else ( || {
114112 SpvError :: QuorumLookupError ( "Masternode engine not available" . to_string ( ) )
@@ -187,10 +185,7 @@ impl SharedMasternodeState {
187185 where
188186 F : FnOnce ( & mut MasternodeListEngine ) -> R ,
189187 {
190- self . engine
191- . write ( )
192- . ok ( )
193- . and_then ( |mut guard| guard. as_mut ( ) . map ( f) )
188+ self . engine . write ( ) . ok ( ) . and_then ( |mut guard| guard. as_mut ( ) . map ( f) )
194189 }
195190
196191 /// Get read access for sync operations that need the full engine.
@@ -199,10 +194,7 @@ impl SharedMasternodeState {
199194 where
200195 F : FnOnce ( & MasternodeListEngine ) -> R ,
201196 {
202- self . engine
203- . read ( )
204- . ok ( )
205- . and_then ( |guard| guard. as_ref ( ) . map ( f) )
197+ self . engine . read ( ) . ok ( ) . and_then ( |guard| guard. as_ref ( ) . map ( f) )
206198 }
207199}
208200
0 commit comments