MCPcopy Create free account
hub / github.com/PacktPublishing/Rust-for-Blockchain-Application-Development / add

Method add

chapter 5/memory_pool.rs:22–25  ·  view source on GitHub ↗
(&self, tx: Transaction)

Source from the content-addressed store, hash-verified

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

Callers 1

serveFunction · 0.45

Calls 1

get_idMethod · 0.45

Tested by

no test coverage detected