(&self, tx: Transaction)
| 20 | } |
| 21 | |
| 22 | pub fn add(&self, tx: Transaction) { |
| 23 | let txid_hex = HEXLOWER.encode(tx.get_id()); |
| 24 | self.inner.write().unwrap().insert(txid_hex, tx); |
| 25 | } |
| 26 | |
| 27 | pub fn get(&self, txid_hex: &str) -> Option<Transaction> { |
| 28 | if let Some(tx) = self.inner.read().unwrap().get(txid_hex) { |