From b0740177f341204d57a42b64dd22594236b1b22b Mon Sep 17 00:00:00 2001 From: lucretius Date: Tue, 23 Jan 2024 17:10:14 +0100 Subject: [PATCH] clean up --- lib/src/lightwallet.rs | 16 ---------------- lib/src/lightwallet/data.rs | 1 - 2 files changed, 17 deletions(-) diff --git a/lib/src/lightwallet.rs b/lib/src/lightwallet.rs index 80a2c0c..e8f5622 100644 --- a/lib/src/lightwallet.rs +++ b/lib/src/lightwallet.rs @@ -1562,20 +1562,11 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 return; } - /*let position = if formatted_memo.as_ref().map_or(false, |m| m.starts_with('{')) { - 1 - } else { - existing_txs.iter() - .filter(|tx| !LightWallet::memo_str(&Some(tx.incoming_metadata.iter().last().unwrap().memo.clone())).as_ref().map_or(false, |m| m.starts_with('{'))) - .count() as u64 + 2 - };*/ - let incoming_metadata = IncomingTxMetadata { address: addr.clone(), value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }; wtx.incoming_metadata.push(incoming_metadata); @@ -1595,7 +1586,6 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }); } else { let mut new_wtx = WalletTx::new(height, now() as u64, &tx.txid()); @@ -1604,14 +1594,12 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }); txs.insert(tx.txid(), new_wtx); } info!("Successfully added txid with memo"); } else { - // let position = 0; // Check if txid already exists in the hashmap let txid_exists = match self.txs.read() { @@ -1633,7 +1621,6 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }; wtx.incoming_metadata.push(incoming_metadata); @@ -1653,7 +1640,6 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }); } else { let mut new_wtx = WalletTx::new(height, now() as u64, &tx.txid()); @@ -1662,7 +1648,6 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 value: amt, memo: memo.clone(), incoming_mempool: true, - // position: position, }); txs.insert(tx.txid(), new_wtx); } @@ -1685,7 +1670,6 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64 } } - // Invalidate all blocks including and after "at_height". // Returns the number of blocks invalidated pub fn invalidate_block(&self, at_height: i32) -> u64 { diff --git a/lib/src/lightwallet/data.rs b/lib/src/lightwallet/data.rs index 0034d1d..5b0208e 100644 --- a/lib/src/lightwallet/data.rs +++ b/lib/src/lightwallet/data.rs @@ -366,7 +366,6 @@ pub struct IncomingTxMetadata { pub value : u64, pub memo : Memo, pub incoming_mempool: bool, - // pub position: u64, } impl IncomingTxMetadata {