@@ -21,7 +21,7 @@ use super::options::RelayPoolOptions;
21
21
use super :: { Error , RelayPoolNotification , SendEventOutput , SendOutput } ;
22
22
use crate :: relay:: options:: { FilterOptions , NegentropyOptions , RelayOptions , RelaySendOptions } ;
23
23
use crate :: relay:: { Relay , RelayBlacklist } ;
24
- use crate :: SubscribeOptions ;
24
+ use crate :: { util , SubscribeOptions } ;
25
25
26
26
#[ derive( Debug , Clone ) ]
27
27
pub struct InternalRelayPool {
@@ -60,8 +60,8 @@ impl InternalRelayPool {
60
60
relays : Arc :: new ( RwLock :: new ( HashMap :: new ( ) ) ) ,
61
61
notification_sender,
62
62
subscriptions : Arc :: new ( RwLock :: new ( HashMap :: new ( ) ) ) ,
63
- blacklist : RelayBlacklist :: empty ( ) , // TODO: allow to initialize pool with custom blacklist?
64
- //opts,
63
+ blacklist : RelayBlacklist :: empty ( ) ,
64
+ //opts,
65
65
}
66
66
}
67
67
@@ -315,13 +315,13 @@ impl InternalRelayPool {
315
315
handle. join ( ) . await ?;
316
316
}
317
317
318
- let result = result . lock ( ) . await ;
318
+ let result: SendOutput = util :: take_mutex_ownership ( result ) . await ;
319
319
320
320
if result. success . is_empty ( ) {
321
321
return Err ( Error :: MsgNotSent ) ;
322
322
}
323
323
324
- Ok ( result. clone ( ) ) // TODO: remove clone
324
+ Ok ( result)
325
325
}
326
326
}
327
327
@@ -438,13 +438,13 @@ impl InternalRelayPool {
438
438
handle. join ( ) . await ?;
439
439
}
440
440
441
- let result = result . lock ( ) . await ;
441
+ let result: SendOutput = util :: take_mutex_ownership ( result ) . await ;
442
442
443
443
if result. success . is_empty ( ) {
444
444
return Err ( Error :: EventNotPublished ) ;
445
445
}
446
446
447
- Ok ( result. clone ( ) ) // TODO: remove clone
447
+ Ok ( result)
448
448
}
449
449
}
450
450
0 commit comments