]> Untitled Git - bdk/commitdiff
Make variable names consistent
authorLLFourn <lloyd.fourn@gmail.com>
Tue, 2 Nov 2021 06:22:24 +0000 (17:22 +1100)
committerLLFourn <lloyd.fourn@gmail.com>
Tue, 9 Nov 2021 22:07:36 +0000 (09:07 +1100)
src/blockchain/electrum.rs
src/blockchain/esplora/reqwest.rs
src/blockchain/esplora/ureq.rs
src/blockchain/script_sync.rs

index 3d316a75ce7ba3ac519d45d537c64a50296ea75b..53fb6e8691da40f387b7a7f7e1b1b6f17b679bcd 100644 (file)
@@ -111,10 +111,10 @@ impl Blockchain for ElectrumBlockchain {
                     script_req.satisfy(txids_per_script)?
                 }
 
-                Request::Conftime(conftimereq) => {
+                Request::Conftime(conftime_req) => {
                     // collect up to chunk_size heights to fetch from electrum
                     let needs_block_height = {
-                        let mut needs_block_height_iter = conftimereq
+                        let mut needs_block_height_iter = conftime_req
                             .request()
                             .filter_map(|txid| txid_to_height.get(txid).cloned())
                             .filter(|height| block_times.get(height).is_none());
@@ -137,7 +137,7 @@ impl Blockchain for ElectrumBlockchain {
                         block_times.insert(height, header.time);
                     }
 
-                    let conftimes = conftimereq
+                    let conftimes = conftime_req
                         .request()
                         .take(chunk_size)
                         .map(|txid| {
@@ -156,10 +156,10 @@ impl Blockchain for ElectrumBlockchain {
                         })
                         .collect::<Result<_, Error>>()?;
 
-                    conftimereq.satisfy(conftimes)?
+                    conftime_req.satisfy(conftimes)?
                 }
-                Request::Tx(txreq) => {
-                    let needs_full = txreq.request().take(chunk_size);
+                Request::Tx(tx_req) => {
+                    let needs_full = tx_req.request().take(chunk_size);
                     tx_cache.save_txs(needs_full.clone())?;
                     let full_transactions = needs_full
                         .map(|txid| tx_cache.get(*txid).ok_or_else(electrum_goof))
@@ -196,7 +196,7 @@ impl Blockchain for ElectrumBlockchain {
                         })
                         .collect::<Result<Vec<_>, Error>>()?;
 
-                    txreq.satisfy(full_details)?
+                    tx_req.satisfy(full_details)?
                 }
                 Request::Finish(batch_update) => break batch_update,
             }
index 8a39cd30eeba7df73bbb2e2760b733e05ecc8a1f..626b8741c0dd21f86f7854978e2670513329639f 100644 (file)
@@ -150,8 +150,8 @@ impl Blockchain for EsploraBlockchain {
 
                     script_req.satisfy(satisfaction)?
                 }
-                Request::Conftime(conftimereq) => {
-                    let conftimes = conftimereq
+                Request::Conftime(conftime_req) => {
+                    let conftimes = conftime_req
                         .request()
                         .map(|txid| {
                             tx_index
@@ -160,17 +160,17 @@ impl Blockchain for EsploraBlockchain {
                                 .confirmation_time()
                         })
                         .collect();
-                    conftimereq.satisfy(conftimes)?
+                    conftime_req.satisfy(conftimes)?
                 }
-                Request::Tx(txreq) => {
-                    let full_txs = txreq
+                Request::Tx(tx_req) => {
+                    let full_txs = tx_req
                         .request()
                         .map(|txid| {
                             let tx = tx_index.get(txid).expect("must be in index");
                             (tx.previous_outputs(), tx.to_tx())
                         })
                         .collect();
-                    txreq.satisfy(full_txs)?
+                    tx_req.satisfy(full_txs)?
                 }
                 Request::Finish(batch_update) => break batch_update,
             }
index 9c980f74d9b0a73310a1b1e4c752d6f0a9b6fd21..339843e6f09bd630bd9cad7450a4c3ec37a4f78b 100644 (file)
@@ -149,8 +149,8 @@ impl Blockchain for EsploraBlockchain {
 
                     script_req.satisfy(satisfaction)?
                 }
-                Request::Conftime(conftimereq) => {
-                    let conftimes = conftimereq
+                Request::Conftime(conftime_req) => {
+                    let conftimes = conftime_req
                         .request()
                         .map(|txid| {
                             tx_index
@@ -159,17 +159,17 @@ impl Blockchain for EsploraBlockchain {
                                 .confirmation_time()
                         })
                         .collect();
-                    conftimereq.satisfy(conftimes)?
+                    conftime_req.satisfy(conftimes)?
                 }
-                Request::Tx(txreq) => {
-                    let full_txs = txreq
+                Request::Tx(tx_req) => {
+                    let full_txs = tx_req
                         .request()
                         .map(|txid| {
                             let tx = tx_index.get(txid).expect("must be in index");
                             (tx.previous_outputs(), tx.to_tx())
                         })
                         .collect();
-                    txreq.satisfy(full_txs)?
+                    tx_req.satisfy(full_txs)?
                 }
                 Request::Finish(batch_update) => break batch_update,
             }
index 247e8154af49219003355a3c80fe595eb3974fbb..da3e648637a5f2aca5bf96fe7169e66799a320ee 100644 (file)
@@ -12,7 +12,7 @@ use bitcoin::{OutPoint, Script, Transaction, TxOut, Txid};
 use log::*;
 use std::collections::{HashMap, HashSet, VecDeque};
 
-/// A reqeust for on-chain information
+/// A request for on-chain information
 pub enum Request<'a, D: BatchDatabase> {
     /// A request for transactions related to script pubkeys.
     Script(ScriptReq<'a, D>),