This commit is contained in:
lucretius
2024-01-23 17:10:14 +01:00
parent 8be65b967a
commit b0740177f3
2 changed files with 0 additions and 17 deletions

View File

@@ -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 {