Skip to content

Commit

Permalink
fix: update threshold to 1/5 instead of 1/2 if servers > 15
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jan 16, 2024
1 parent ad6839d commit 9577668
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ else if (!tx.getOutput(utxo.getIndex()).getScriptPubKey().equals(outputScript))
}
}

final int trustThreshold = servers.size() / 5; // since there are 30+ servers, require 6 with good results.
final int trustThreshold = servers.size() / (servers.size() > 15 ? 5 : 2); // since there are 30+ servers, require 6 with good results.
for (final Iterator<Multiset.Entry<UTXO>> i = countedUtxos.entrySet().iterator(); i.hasNext();) {
final Multiset.Entry<UTXO> entry = i.next();
if (entry.getCount() < trustThreshold)
Expand Down

0 comments on commit 9577668

Please sign in to comment.