From 9577668a69a373275a80834d977628f5c9b19419 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Tue, 16 Jan 2024 12:53:41 -0800 Subject: [PATCH] fix: update threshold to 1/5 instead of 1/2 if servers > 15 --- .../de/schildbach/wallet/ui/send/RequestWalletBalanceTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/src/de/schildbach/wallet/ui/send/RequestWalletBalanceTask.java b/wallet/src/de/schildbach/wallet/ui/send/RequestWalletBalanceTask.java index f26636d360..7a47c2557a 100644 --- a/wallet/src/de/schildbach/wallet/ui/send/RequestWalletBalanceTask.java +++ b/wallet/src/de/schildbach/wallet/ui/send/RequestWalletBalanceTask.java @@ -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> i = countedUtxos.entrySet().iterator(); i.hasNext();) { final Multiset.Entry entry = i.next(); if (entry.getCount() < trustThreshold)