Пример #1
0
  private void doOpenDispute(boolean isSupportTicket, Transaction depositTx) {
    Log.traceCall("depositTx=" + depositTx);
    byte[] depositTxSerialized = null;
    byte[] payoutTxSerialized = null;
    String depositTxHashAsString = null;
    String payoutTxHashAsString = null;
    if (depositTx != null) {
      depositTxSerialized = depositTx.bitcoinSerialize();
      depositTxHashAsString = depositTx.getHashAsString();
    } else {
      log.warn("depositTx is null");
    }
    Transaction payoutTx = trade.getPayoutTx();
    if (payoutTx != null) {
      payoutTxSerialized = payoutTx.bitcoinSerialize();
      payoutTxHashAsString = payoutTx.getHashAsString();
    }

    Dispute dispute =
        new Dispute(
            disputeManager.getDisputeStorage(),
            trade.getId(),
            keyRing.getPubKeyRing().hashCode(), // traderId
            trade.getOffer().getDirection() == Offer.Direction.BUY ? isOfferer : !isOfferer,
            isOfferer,
            keyRing.getPubKeyRing(),
            trade.getDate(),
            trade.getContract(),
            trade.getContractHash(),
            depositTxSerialized,
            payoutTxSerialized,
            depositTxHashAsString,
            payoutTxHashAsString,
            trade.getContractAsJson(),
            trade.getOffererContractSignature(),
            trade.getTakerContractSignature(),
            user.getAcceptedArbitratorByAddress(trade.getArbitratorNodeAddress()).getPubKeyRing(),
            isSupportTicket);

    trade.setDisputeState(Trade.DisputeState.DISPUTE_REQUESTED);
    disputeManager.sendOpenNewDisputeMessage(dispute);
    navigation.navigateTo(MainView.class, DisputesView.class);
  }
Пример #2
0
 protected void setFilteredListPredicate(FilteredList<Dispute> filteredList) {
   filteredList.setPredicate(
       dispute -> !dispute.getArbitratorPubKeyRing().equals(keyRing.getPubKeyRing()));
 }
Пример #3
0
 private OfferAvailabilityModel getOfferAvailabilityModel(Offer offer) {
   return new OfferAvailabilityModel(offer, keyRing.getPubKeyRing(), p2PService);
 }