Skip to content

Commit

Permalink
fix: do not broadcast bonus transaction when a new block is mined
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Jun 13, 2020
1 parent 205030e commit d75dd4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nb"
version = "0.3.0"
version = "0.3.1"
authors = ["xxchan <[email protected]>", "Keith Null <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ impl Node {
let last_hash = last_block.get_hash();
// receive a reward for finding the proof.
// The sender is "0" to signify that this node has mined a new coin.
// TODO: This bonus transaction should not broadcast
self.create_and_add_new_transaction("0", &self.basic_info.id.clone(), 1);
let bonus_trans = Transaction::new("0", &self.basic_info.id.clone(), 1);
self.chain.add_new_transaction(&bonus_trans);

let block = self.chain.create_new_block(proof, last_hash);
info!(
Expand Down

0 comments on commit d75dd4e

Please sign in to comment.