tor-circmgr: Don't clone parameters in create_chantarget()
This commit is contained in:
parent
12045cb454
commit
383843f0d7
|
@ -101,8 +101,7 @@ impl Buildable for Arc<ClientCirc> {
|
|||
params: &CircParameters,
|
||||
) -> Result<Self> {
|
||||
let circ = create_common(chanmgr, rt, rng, ct).await?;
|
||||
// FIXME(eta): don't clone the params?
|
||||
Ok(Arc::new(circ.create_firsthop_fast(params.clone()).await?))
|
||||
Ok(Arc::new(circ.create_firsthop_fast(params).await?))
|
||||
}
|
||||
async fn create<RNG: CryptoRng + Rng + Send, RT: Runtime>(
|
||||
chanmgr: &ChanMgr<RT>,
|
||||
|
|
|
@ -532,7 +532,8 @@ pub(crate) mod test {
|
|||
reactor.run_once().await.unwrap();
|
||||
};
|
||||
|
||||
let (circ, _) = futures::join!(pending.create_firsthop_fast(circparams), send_response);
|
||||
let (circ, _) =
|
||||
futures::join!(pending.create_firsthop_fast(&circparams), send_response);
|
||||
// Make sure statuses are as expected.
|
||||
assert!(matches!(circ.err().unwrap(), Error::BadHandshake));
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ impl PendingClientCirc {
|
|||
/// There's no authentication in CRATE_FAST,
|
||||
/// so we don't need to know whom we're connecting to: we're just
|
||||
/// connecting to whichever relay the channel is for.
|
||||
pub async fn create_firsthop_fast(self, params: CircParameters) -> Result<ClientCirc> {
|
||||
pub async fn create_firsthop_fast(self, params: &CircParameters) -> Result<ClientCirc> {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
self.circ
|
||||
.control
|
||||
|
@ -747,7 +747,7 @@ mod test {
|
|||
let params = CircParameters::default();
|
||||
let ret = if fast {
|
||||
trace!("doing fast create");
|
||||
pending.create_firsthop_fast(params).await
|
||||
pending.create_firsthop_fast(¶ms).await
|
||||
} else {
|
||||
trace!("doing ntor create");
|
||||
pending.create_firsthop_ntor(&target, params).await
|
||||
|
|
Loading…
Reference in New Issue