Make variable names consistent
This commit is contained in:
		
							parent
							
								
									5eadf5ccf9
								
							
						
					
					
						commit
						188d9a4a8b
					
				| @ -111,10 +111,10 @@ impl Blockchain for ElectrumBlockchain { | |||||||
|                     script_req.satisfy(txids_per_script)? |                     script_req.satisfy(txids_per_script)? | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 Request::Conftime(conftimereq) => { |                 Request::Conftime(conftime_req) => { | ||||||
|                     // collect up to chunk_size heights to fetch from electrum
 |                     // collect up to chunk_size heights to fetch from electrum
 | ||||||
|                     let needs_block_height = { |                     let needs_block_height = { | ||||||
|                         let mut needs_block_height_iter = conftimereq |                         let mut needs_block_height_iter = conftime_req | ||||||
|                             .request() |                             .request() | ||||||
|                             .filter_map(|txid| txid_to_height.get(txid).cloned()) |                             .filter_map(|txid| txid_to_height.get(txid).cloned()) | ||||||
|                             .filter(|height| block_times.get(height).is_none()); |                             .filter(|height| block_times.get(height).is_none()); | ||||||
| @ -137,7 +137,7 @@ impl Blockchain for ElectrumBlockchain { | |||||||
|                         block_times.insert(height, header.time); |                         block_times.insert(height, header.time); | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     let conftimes = conftimereq |                     let conftimes = conftime_req | ||||||
|                         .request() |                         .request() | ||||||
|                         .take(chunk_size) |                         .take(chunk_size) | ||||||
|                         .map(|txid| { |                         .map(|txid| { | ||||||
| @ -156,10 +156,10 @@ impl Blockchain for ElectrumBlockchain { | |||||||
|                         }) |                         }) | ||||||
|                         .collect::<Result<_, Error>>()?; |                         .collect::<Result<_, Error>>()?; | ||||||
| 
 | 
 | ||||||
|                     conftimereq.satisfy(conftimes)? |                     conftime_req.satisfy(conftimes)? | ||||||
|                 } |                 } | ||||||
|                 Request::Tx(txreq) => { |                 Request::Tx(tx_req) => { | ||||||
|                     let needs_full = txreq.request().take(chunk_size); |                     let needs_full = tx_req.request().take(chunk_size); | ||||||
|                     tx_cache.save_txs(needs_full.clone())?; |                     tx_cache.save_txs(needs_full.clone())?; | ||||||
|                     let full_transactions = needs_full |                     let full_transactions = needs_full | ||||||
|                         .map(|txid| tx_cache.get(*txid).ok_or_else(electrum_goof)) |                         .map(|txid| tx_cache.get(*txid).ok_or_else(electrum_goof)) | ||||||
| @ -196,7 +196,7 @@ impl Blockchain for ElectrumBlockchain { | |||||||
|                         }) |                         }) | ||||||
|                         .collect::<Result<Vec<_>, Error>>()?; |                         .collect::<Result<Vec<_>, Error>>()?; | ||||||
| 
 | 
 | ||||||
|                     txreq.satisfy(full_details)? |                     tx_req.satisfy(full_details)? | ||||||
|                 } |                 } | ||||||
|                 Request::Finish(batch_update) => break batch_update, |                 Request::Finish(batch_update) => break batch_update, | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -150,8 +150,8 @@ impl Blockchain for EsploraBlockchain { | |||||||
| 
 | 
 | ||||||
|                     script_req.satisfy(satisfaction)? |                     script_req.satisfy(satisfaction)? | ||||||
|                 } |                 } | ||||||
|                 Request::Conftime(conftimereq) => { |                 Request::Conftime(conftime_req) => { | ||||||
|                     let conftimes = conftimereq |                     let conftimes = conftime_req | ||||||
|                         .request() |                         .request() | ||||||
|                         .map(|txid| { |                         .map(|txid| { | ||||||
|                             tx_index |                             tx_index | ||||||
| @ -160,17 +160,17 @@ impl Blockchain for EsploraBlockchain { | |||||||
|                                 .confirmation_time() |                                 .confirmation_time() | ||||||
|                         }) |                         }) | ||||||
|                         .collect(); |                         .collect(); | ||||||
|                     conftimereq.satisfy(conftimes)? |                     conftime_req.satisfy(conftimes)? | ||||||
|                 } |                 } | ||||||
|                 Request::Tx(txreq) => { |                 Request::Tx(tx_req) => { | ||||||
|                     let full_txs = txreq |                     let full_txs = tx_req | ||||||
|                         .request() |                         .request() | ||||||
|                         .map(|txid| { |                         .map(|txid| { | ||||||
|                             let tx = tx_index.get(txid).expect("must be in index"); |                             let tx = tx_index.get(txid).expect("must be in index"); | ||||||
|                             (tx.previous_outputs(), tx.to_tx()) |                             (tx.previous_outputs(), tx.to_tx()) | ||||||
|                         }) |                         }) | ||||||
|                         .collect(); |                         .collect(); | ||||||
|                     txreq.satisfy(full_txs)? |                     tx_req.satisfy(full_txs)? | ||||||
|                 } |                 } | ||||||
|                 Request::Finish(batch_update) => break batch_update, |                 Request::Finish(batch_update) => break batch_update, | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -149,8 +149,8 @@ impl Blockchain for EsploraBlockchain { | |||||||
| 
 | 
 | ||||||
|                     script_req.satisfy(satisfaction)? |                     script_req.satisfy(satisfaction)? | ||||||
|                 } |                 } | ||||||
|                 Request::Conftime(conftimereq) => { |                 Request::Conftime(conftime_req) => { | ||||||
|                     let conftimes = conftimereq |                     let conftimes = conftime_req | ||||||
|                         .request() |                         .request() | ||||||
|                         .map(|txid| { |                         .map(|txid| { | ||||||
|                             tx_index |                             tx_index | ||||||
| @ -159,17 +159,17 @@ impl Blockchain for EsploraBlockchain { | |||||||
|                                 .confirmation_time() |                                 .confirmation_time() | ||||||
|                         }) |                         }) | ||||||
|                         .collect(); |                         .collect(); | ||||||
|                     conftimereq.satisfy(conftimes)? |                     conftime_req.satisfy(conftimes)? | ||||||
|                 } |                 } | ||||||
|                 Request::Tx(txreq) => { |                 Request::Tx(tx_req) => { | ||||||
|                     let full_txs = txreq |                     let full_txs = tx_req | ||||||
|                         .request() |                         .request() | ||||||
|                         .map(|txid| { |                         .map(|txid| { | ||||||
|                             let tx = tx_index.get(txid).expect("must be in index"); |                             let tx = tx_index.get(txid).expect("must be in index"); | ||||||
|                             (tx.previous_outputs(), tx.to_tx()) |                             (tx.previous_outputs(), tx.to_tx()) | ||||||
|                         }) |                         }) | ||||||
|                         .collect(); |                         .collect(); | ||||||
|                     txreq.satisfy(full_txs)? |                     tx_req.satisfy(full_txs)? | ||||||
|                 } |                 } | ||||||
|                 Request::Finish(batch_update) => break batch_update, |                 Request::Finish(batch_update) => break batch_update, | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -12,7 +12,7 @@ use bitcoin::{OutPoint, Script, Transaction, TxOut, Txid}; | |||||||
| use log::*; | use log::*; | ||||||
| use std::collections::{HashMap, HashSet, VecDeque}; | use std::collections::{HashMap, HashSet, VecDeque}; | ||||||
| 
 | 
 | ||||||
| /// A reqeust for on-chain information
 | /// A request for on-chain information
 | ||||||
| pub enum Request<'a, D: BatchDatabase> { | pub enum Request<'a, D: BatchDatabase> { | ||||||
|     /// A request for transactions related to script pubkeys.
 |     /// A request for transactions related to script pubkeys.
 | ||||||
|     Script(ScriptReq<'a, D>), |     Script(ScriptReq<'a, D>), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user