Compare commits
1 Commits
mempool
...
refactor-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4fec0c445 |
@ -171,8 +171,8 @@ impl Tracker {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_txn(&self, txid: &Sha256dHash) -> Option<Transaction> {
|
||||
self.items.get(txid).map(|stats| stats.tx.clone())
|
||||
pub fn contains(&self, txid: &Sha256dHash) -> bool {
|
||||
self.items.contains_key(txid)
|
||||
}
|
||||
|
||||
/// Returns vector of (fee_rate, vsize) pairs, where fee_{n-1} > fee_n and vsize_n is the
|
||||
|
||||
@ -319,7 +319,7 @@ impl Query {
|
||||
tx_hash: &Sha256dHash,
|
||||
block_height: Option<u32>,
|
||||
) -> Result<Option<Sha256dHash>> {
|
||||
let blockhash = if self.tracker.read().unwrap().get_txn(&tx_hash).is_some() {
|
||||
let blockhash = if self.tracker.read().unwrap().contains(&tx_hash) {
|
||||
None // found in mempool (as unconfirmed transaction)
|
||||
} else {
|
||||
// Lookup in confirmed transactions' index
|
||||
|
||||
Loading…
Reference in New Issue
Block a user