File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ pub struct NostrManager {
5555 session_salt : [ u8 ; 16 ] ,
5656 timeout : Duration ,
5757 pub ( crate ) event_tracker : std:: sync:: Arc < dyn EventTracker > ,
58+ signer_lock : std:: sync:: Arc < tokio:: sync:: Mutex < ( ) > > ,
5859 // blossom: BlossomClient,
5960}
6061
@@ -181,6 +182,7 @@ impl NostrManager {
181182 session_salt,
182183 timeout,
183184 event_tracker,
185+ signer_lock : std:: sync:: Arc :: new ( tokio:: sync:: Mutex :: new ( ( ) ) ) ,
184186 } )
185187 }
186188
@@ -193,6 +195,7 @@ impl NostrManager {
193195 F : FnOnce ( ) -> Fut ,
194196 Fut : std:: future:: Future < Output = Result < T > > + Send ,
195197 {
198+ let _guard = self . signer_lock . lock ( ) . await ;
196199 self . client . set_signer ( signer) . await ;
197200 let result = f ( ) . await ;
198201 self . client . unset_signer ( ) . await ;
You can’t perform that action at this time.
0 commit comments