garritfra
6 years ago
6 changed files with 50 additions and 14 deletions
@ -1,3 +1,4 @@
|
||||
pub mod block; |
||||
pub mod blockchain; |
||||
pub mod transaction; |
||||
pub mod tx_pool; |
||||
|
@ -0,0 +1,20 @@
|
||||
use core::transaction::Transaction; |
||||
pub struct Tx_pool { |
||||
pub transactions: Vec<Transaction>, |
||||
} |
||||
|
||||
pub fn new() -> Tx_pool { |
||||
Tx_pool { |
||||
transactions: Vec::new(), |
||||
} |
||||
} |
||||
|
||||
impl Tx_pool { |
||||
pub fn add(&mut self, transaction: Transaction) { |
||||
self.transactions.push(transaction); |
||||
} |
||||
|
||||
pub fn sanatize(&mut self) { |
||||
self.transactions.clear(); |
||||
} |
||||
} |
Loading…
Reference in new issue