From 959285c9356c2110e2b0275ebc6c193b1bec04bc Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Fri, 22 Nov 2024 16:29:04 -0500 Subject: [PATCH] f Cleanup --- src/chain/bitcoind_rpc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chain/bitcoind_rpc.rs b/src/chain/bitcoind_rpc.rs index c0b4cf99e..871dd8a42 100644 --- a/src/chain/bitcoind_rpc.rs +++ b/src/chain/bitcoind_rpc.rs @@ -121,19 +121,19 @@ impl BitcoindRpcClient { .map(|resp| resp.0) } - pub(crate) async fn get_mempool_entry(&self, txid: &Txid) -> std::io::Result { - let txid_hex = bitcoin::consensus::encode::serialize_hex(txid); + pub(crate) async fn get_mempool_entry(&self, txid: Txid) -> std::io::Result { + let txid_hex = bitcoin::consensus::encode::serialize_hex(&txid); let txid_json = serde_json::json!(txid_hex); self.rpc_client .call_method::("getmempoolentry", &vec![txid_json]) .await - .map(|resp| MempoolEntry { txid: txid.clone(), height: resp.height, time: resp.time }) + .map(|resp| MempoolEntry { txid, height: resp.height, time: resp.time }) } pub(crate) async fn get_mempool_entries(&self) -> std::io::Result> { let mempool_txids = self.get_raw_mempool().await?; let mut mempool_entries = Vec::with_capacity(mempool_txids.len()); - for txid in &mempool_txids { + for txid in mempool_txids { let entry = self.get_mempool_entry(txid).await?; mempool_entries.push(entry); }