use of bisq.core.arbitration.Arbitrator in project bisq-core by bisq-network.
the class Trade method getArbitratorBtcPubKey.
public byte[] getArbitratorBtcPubKey() {
// Only new trades cannot start without any arbitrator
if (arbitratorBtcPubKey == null) {
Arbitrator arbitrator = processModel.getUser().getAcceptedArbitratorByAddress(arbitratorNodeAddress);
checkNotNull(arbitrator, "arbitrator must not be null");
arbitratorBtcPubKey = arbitrator.getBtcPubKey();
}
checkNotNull(arbitratorBtcPubKey, "ArbitratorPubKey must not be null");
return arbitratorBtcPubKey;
}
use of bisq.core.arbitration.Arbitrator in project bisq-core by bisq-network.
the class Trade method setArbitratorNodeAddress.
@SuppressWarnings("NullableProblems")
public void setArbitratorNodeAddress(NodeAddress arbitratorNodeAddress) {
this.arbitratorNodeAddress = arbitratorNodeAddress;
if (processModel.getUser() != null) {
Arbitrator arbitrator = processModel.getUser().getAcceptedArbitratorByAddress(arbitratorNodeAddress);
checkNotNull(arbitrator, "arbitrator must not be null");
arbitratorBtcPubKey = arbitrator.getBtcPubKey();
arbitratorPubKeyRing = arbitrator.getPubKeyRing();
persist();
}
}
use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.
the class ArbitratorRegistrationViewModel method onRegister.
void onRegister(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
updateDisableStates();
if (allDataValid) {
AddressEntry arbitratorDepositAddressEntry = walletService.getOrCreateAddressEntry(AddressEntry.Context.ARBITRATOR);
String registrationSignature = arbitratorManager.signStorageSignaturePubKey(registrationKey);
// TODO not impl in UI
String emailAddress = null;
@SuppressWarnings("ConstantConditions") Arbitrator arbitrator = new Arbitrator(p2PService.getAddress(), arbitratorDepositAddressEntry.getPubKey(), arbitratorDepositAddressEntry.getAddressString(), keyRing.getPubKeyRing(), new ArrayList<>(languageCodes), new Date().getTime(), registrationKey.getPubKey(), registrationSignature, emailAddress, null, null);
arbitratorManager.addArbitrator(arbitrator, () -> {
updateDisableStates();
resultHandler.handleResult();
}, (errorMessage) -> {
updateDisableStates();
errorMessageHandler.handleErrorMessage(errorMessage);
});
}
}
use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.
the class ArbitratorRegistrationViewModel method activate.
@Override
protected void activate() {
arbitratorManager.getArbitratorsObservableMap().addListener(arbitratorMapChangeListener);
Arbitrator myRegisteredArbitrator = user.getRegisteredArbitrator();
myArbitratorProperty.set(myRegisteredArbitrator);
updateDisableStates();
}
use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.
the class ArbitratorSelectionViewModel method updateAutoSelectArbitrators.
private void updateAutoSelectArbitrators() {
if (preferences.isAutoSelectArbitrators()) {
arbitratorListItems.stream().forEach(item -> {
Arbitrator arbitrator = item.arbitrator;
if (!isMyOwnRegisteredArbitrator(arbitrator)) {
if (hasMatchingLanguage(arbitrator)) {
onAddArbitrator(arbitrator);
item.setIsSelected(true);
} else {
onRemoveArbitrator(arbitrator);
item.setIsSelected(false);
}
} else {
item.setIsSelected(false);
}
});
}
}
Aggregations