clean up
This commit is contained in:
@@ -1562,20 +1562,11 @@ pub fn scan_full_mempool_tx(&self, tx: &Transaction, height: i32, _datetime: u64
|
|||||||
return;
|
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 {
|
let incoming_metadata = IncomingTxMetadata {
|
||||||
address: addr.clone(),
|
address: addr.clone(),
|
||||||
value: amt,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wtx.incoming_metadata.push(incoming_metadata);
|
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,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let mut new_wtx = WalletTx::new(height, now() as u64, &tx.txid());
|
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,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
});
|
});
|
||||||
txs.insert(tx.txid(), new_wtx);
|
txs.insert(tx.txid(), new_wtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Successfully added txid with memo");
|
info!("Successfully added txid with memo");
|
||||||
} else {
|
} else {
|
||||||
// let position = 0;
|
|
||||||
|
|
||||||
// Check if txid already exists in the hashmap
|
// Check if txid already exists in the hashmap
|
||||||
let txid_exists = match self.txs.read() {
|
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,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wtx.incoming_metadata.push(incoming_metadata);
|
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,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let mut new_wtx = WalletTx::new(height, now() as u64, &tx.txid());
|
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,
|
value: amt,
|
||||||
memo: memo.clone(),
|
memo: memo.clone(),
|
||||||
incoming_mempool: true,
|
incoming_mempool: true,
|
||||||
// position: position,
|
|
||||||
});
|
});
|
||||||
txs.insert(tx.txid(), new_wtx);
|
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".
|
// Invalidate all blocks including and after "at_height".
|
||||||
// Returns the number of blocks invalidated
|
// Returns the number of blocks invalidated
|
||||||
pub fn invalidate_block(&self, at_height: i32) -> u64 {
|
pub fn invalidate_block(&self, at_height: i32) -> u64 {
|
||||||
|
|||||||
@@ -366,7 +366,6 @@ pub struct IncomingTxMetadata {
|
|||||||
pub value : u64,
|
pub value : u64,
|
||||||
pub memo : Memo,
|
pub memo : Memo,
|
||||||
pub incoming_mempool: bool,
|
pub incoming_mempool: bool,
|
||||||
// pub position: u64,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IncomingTxMetadata {
|
impl IncomingTxMetadata {
|
||||||
|
|||||||
Reference in New Issue
Block a user