Browse Source

Merge branch 'rust-port' of https://github.com/garritfra/blockchain-project into rust-port

rust-port
garritfra 6 years ago
parent
commit
391cd61205
  1. 6
      src/core/block.rs
  2. 4
      src/core/blockchain.rs

6
src/core/block.rs

@ -10,12 +10,6 @@ pub fn new() -> Block {
}
}
impl Block {
pub fn add_transaction(&mut self, transaction: Transaction) {
self.transactions.push(transaction);
}
}
pub fn create_genesis() -> Block {
Block {
transactions: Vec::new(),

4
src/core/blockchain.rs

@ -29,11 +29,11 @@ impl Blockchain {
}
fn clear_transactions(&mut self) {
&self.tx_pool.transactions.clear();
self.tx_pool.sanatize()
}
pub fn add_pending_transaction(&mut self, transaction: Transaction) {
self.tx_pool.transactions.push(transaction);
self.tx_pool.add(transaction)
}
pub fn get_blocks(&mut self) -> &Vec<block::Block> {

Loading…
Cancel
Save