Fixed a problem with allowed mining while waiting for signers.

Sped up initial blocks downloading.
Changed block consensus a bit.
This commit is contained in:
Revertron
2021-04-23 01:09:38 +02:00
parent dee53887cb
commit 0d944ca1dc
5 changed files with 34 additions and 56 deletions
+2 -15
View File
@@ -73,24 +73,11 @@ impl Block {
if self.transaction.is_some() && other.transaction.is_none() {
return true;
}
let my_diff = hash_difficulty(self.hash.as_slice());
let it_diff = hash_difficulty(other.hash.as_slice());
let my_diff = hash_difficulty(self.hash.as_slice()) + key_hash_difficulty(self.hash.as_slice());
let it_diff = hash_difficulty(other.hash.as_slice()) + key_hash_difficulty(other.hash.as_slice());
if my_diff > it_diff {
return true;
}
let my_diff = key_hash_difficulty(self.hash.as_slice());
let it_diff = key_hash_difficulty(other.hash.as_slice());
if my_diff > it_diff {
return true;
}
let my_diff = hash_difficulty(self.signature.as_slice());
let it_diff = hash_difficulty(other.signature.as_slice());
if my_diff > it_diff {
return true;
}
if self.nonce < other.nonce {
return true;
}
false
}