mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 15:26:03 -04:00
Fix nullpointer, fix wrong hash at arb. select.
This commit is contained in:
parent
840a233544
commit
ceae998bee
@ -24,6 +24,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -39,7 +40,7 @@ public class ArbitrationSelectionRule {
|
||||
}
|
||||
checkArgument(candidates.size() > 0, "candidates.size() <= 0");
|
||||
|
||||
int index = Math.abs(Sha256Hash.hash(offer.getId().getBytes()).hashCode()) % candidates.size();
|
||||
int index = Math.abs(Arrays.hashCode(Sha256Hash.hash(offer.getId().getBytes()))) % candidates.size();
|
||||
NodeAddress selectedArbitrator = candidates.get(index);
|
||||
log.debug("selectedArbitrator " + selectedArbitrator);
|
||||
return selectedArbitrator;
|
||||
|
@ -101,7 +101,6 @@ public class EmptyWalletPopup extends Popup {
|
||||
emptyWalletButton = new Button("Empty wallet");
|
||||
boolean isBalanceSufficient = Restrictions.isAboveDust(totalBalance);
|
||||
emptyWalletButton.setDefaultButton(isBalanceSufficient);
|
||||
closeButton.setDefaultButton(!isBalanceSufficient);
|
||||
emptyWalletButton.setDisable(!isBalanceSufficient && addressInputTextField.getText().length() > 0);
|
||||
emptyWalletButton.setOnAction(e -> {
|
||||
if (addressInputTextField.getText().length() > 0 && isBalanceSufficient) {
|
||||
@ -121,6 +120,7 @@ public class EmptyWalletPopup extends Popup {
|
||||
hide();
|
||||
closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
|
||||
});
|
||||
closeButton.setDefaultButton(!isBalanceSufficient);
|
||||
|
||||
HBox hBox = new HBox();
|
||||
hBox.setSpacing(10);
|
||||
|
Loading…
x
Reference in New Issue
Block a user