Skip to content

Commit

Permalink
Fixed block precedence calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Revertron committed Jul 10, 2022
1 parent a13c824 commit a27b6cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion alfis.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ yggdrasil_only = false
# Your DNS resolver will be listening on this address and port (Usual port is 53)
listen = "127.0.0.1:53"
# How many threads to spawn by DNS server
threads = 50
threads = 10
# AdGuard DNS servers to filter ads and trackers
forwarders = ["https://dns.adguard.com/dns-query"]
#forwarders = ["94.140.14.14:53", "94.140.15.15:53"]
Expand Down
4 changes: 4 additions & 0 deletions src/blockchain/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ impl Block {
return true;
}

if my_diff == it_diff && self.nonce != other.nonce {
return self.nonce < other.nonce;
}

false
}
}
2 changes: 1 addition & 1 deletion src/dns/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ impl HttpsDnsClient {
let agent = ureq::AgentBuilder::new()
.user_agent(&client_name)
.timeout(std::time::Duration::from_secs(5))
.max_idle_connections_per_host(8)
.max_idle_connections_per_host(2)
.max_idle_connections(16)
.resolver(move |addr: &str| {
let addr = match addr.find(':') {
Expand Down
2 changes: 1 addition & 1 deletion src/web_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ fn action_create_domain(context: Arc<Mutex<Context>>, miner: Arc<Mutex<Miner>>,
};
match context.chain.can_mine_domain(context.chain.get_height(), &name, &pub_key) {
MineResult::Fine => {
std::mem::drop(context);
drop(context);
create_domain(c, miner, CLASS_DOMAIN, &name, data, DOMAIN_DIFFICULTY, &keystore, signing, encryption, renewal);
let _ = web_view.eval("domainMiningStarted();");
event_info(web_view, &format!("Mining of domain \\'{}\\' has started", &name));
Expand Down

0 comments on commit a27b6cc

Please sign in to comment.