Implemented loading Settings from file. Implemented mining of Keystore (key pair). Changed Transaction structure a lot. Added an icon to windows build. Changed some HTML.

This commit is contained in:
Revertron
2021-01-18 00:18:35 +01:00
parent 4703ae6f49
commit 70b3a833b9
15 changed files with 11036 additions and 299 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
use crate::{Block, Transaction, Key};
use crate::{Block, Transaction, Bytes};
use chrono::Utc;
pub struct Blockchain {
@@ -54,7 +54,7 @@ impl Blockchain {
pub fn check_block_hash(block: &Block) -> bool {
// We need to clear Hash value to rehash it without it for check :(
let mut copy: Block = block.clone();
copy.hash = Key::default();
copy.hash = Bytes::default();
let data = serde_json::to_string(&copy).unwrap();
Block::hash(data.as_bytes()) == block.hash
}