mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-20 21:04:28 -04:00
Exclude 2nd log binding, cleanup, reformat
This commit is contained in:
parent
c4d56d43f4
commit
8713f9d835
38 changed files with 82 additions and 60 deletions
|
@ -192,6 +192,14 @@
|
||||||
<groupId>com.vinumeris</groupId>
|
<groupId>com.vinumeris</groupId>
|
||||||
<artifactId>updatefx</artifactId>
|
<artifactId>updatefx</artifactId>
|
||||||
<version>1.2</version>
|
<version>1.2</version>
|
||||||
|
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-jdk14</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class Arbitrator implements Serializable {
|
||||||
List<ID_VERIFICATION> idVerifications,
|
List<ID_VERIFICATION> idVerifications,
|
||||||
String webUrl,
|
String webUrl,
|
||||||
String description) {
|
String description) {
|
||||||
this.pubKey=pubKey;
|
this.pubKey = pubKey;
|
||||||
this.messagePubKeyAsHex = messagePubKeyAsHex;
|
this.messagePubKeyAsHex = messagePubKeyAsHex;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.idType = idType;
|
this.idType = idType;
|
||||||
|
|
|
@ -53,12 +53,13 @@ class AddressBasedCoinSelector extends DefaultCoinSelector {
|
||||||
// Constructor
|
// Constructor
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public AddressBasedCoinSelector(NetworkParameters params, AddressEntry addressEntry, boolean includePending) {
|
public AddressBasedCoinSelector(NetworkParameters params, AddressEntry addressEntry, @SuppressWarnings("SameParameterValue") boolean includePending) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.addressEntry = addressEntry;
|
this.addressEntry = addressEntry;
|
||||||
this.includePending = includePending;
|
this.includePending = includePending;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess")
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static void sortOutputs(ArrayList<TransactionOutput> outputs) {
|
static void sortOutputs(ArrayList<TransactionOutput> outputs) {
|
||||||
Collections.sort(outputs, (a, b) -> {
|
Collections.sort(outputs, (a, b) -> {
|
||||||
|
@ -130,14 +131,14 @@ class AddressBasedCoinSelector extends DefaultCoinSelector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean matchesRequiredAddress(TransactionOutput transactionOutput) {
|
private boolean matchesRequiredAddress(TransactionOutput transactionOutput) {
|
||||||
if (transactionOutput.getScriptPubKey().isSentToAddress() || transactionOutput.getScriptPubKey().isSentToP2SH
|
if (transactionOutput.getScriptPubKey().isSentToAddress() || transactionOutput.getScriptPubKey().isPayToScriptHash
|
||||||
()) {
|
()) {
|
||||||
Address addressOutput = transactionOutput.getScriptPubKey().getToAddress(params);
|
Address addressOutput = transactionOutput.getScriptPubKey().getToAddress(params);
|
||||||
log.trace("matchesRequiredAddress?");
|
log.trace("matchesRequiredAddress?");
|
||||||
log.trace(addressOutput.toString());
|
log.trace(addressOutput.toString());
|
||||||
log.trace(addressEntry.getAddress().toString());
|
log.trace(addressEntry.getAddress().toString());
|
||||||
|
|
||||||
if (addressEntry != null && addressOutput.equals(addressEntry.getAddress())) {
|
if (addressOutput.equals(addressEntry.getAddress())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
log.warn("No match found at matchesRequiredAddress addressOutput/addressEntry " + addressOutput.toString
|
log.warn("No match found at matchesRequiredAddress addressOutput/addressEntry " + addressOutput.toString
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class AddressEntry implements Serializable {
|
||||||
private final byte[] pubKey;
|
private final byte[] pubKey;
|
||||||
private final byte[] pubKeyHash;
|
private final byte[] pubKeyHash;
|
||||||
|
|
||||||
public AddressEntry(DeterministicKey keyPair, NetworkParameters params, AddressContext addressContext) {
|
public AddressEntry(DeterministicKey keyPair, NetworkParameters params, @SuppressWarnings("SameParameterValue") AddressContext addressContext) {
|
||||||
this(keyPair, params, addressContext, null);
|
this(keyPair, params, addressContext, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import javax.inject.Inject;
|
||||||
/**
|
/**
|
||||||
* A service delivers blockchain functionality from the BitcoinJ library.
|
* A service delivers blockchain functionality from the BitcoinJ library.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings({"UnusedDeclaration", "UnusedParameters"})
|
||||||
public class BlockChainService {
|
public class BlockChainService {
|
||||||
@Inject
|
@Inject
|
||||||
public BlockChainService() {
|
public BlockChainService() {
|
||||||
|
@ -31,36 +32,43 @@ public class BlockChainService {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
public boolean isAccountBlackListed(String accountID, BankAccount bankAccount) {
|
@SuppressWarnings("SameReturnValue")
|
||||||
|
public boolean isAccountBlackListed(String accountId, BankAccount bankAccount) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
public boolean verifyAccountRegistration() {
|
public boolean verifyAccountRegistration() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
private boolean findAddressInBlockChain(String address) {
|
private boolean findAddressInBlockChain(String address) {
|
||||||
// TODO lookup for address in blockchain
|
// TODO lookup for address in blockchain
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
private byte[] getDataForTxWithAddress(String address) {
|
private byte[] getDataForTxWithAddress(String address) {
|
||||||
// TODO return data after OP_RETURN
|
// TODO return data after OP_RETURN
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
private boolean isFeePayed(String address) {
|
private boolean isFeePayed(String address) {
|
||||||
// TODO check if fee is paid
|
// TODO check if fee is paid
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
private boolean isAccountIDBlacklisted(String accountID) {
|
private boolean isAccountIDBlacklisted(String accountID) {
|
||||||
// TODO check if accountID is on blacklist
|
// TODO check if accountID is on blacklist
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("SameReturnValue")
|
||||||
private boolean isBankAccountBlacklisted(BankAccount bankAccount) {
|
private boolean isBankAccountBlacklisted(BankAccount bankAccount) {
|
||||||
// TODO check if accountID is on blacklist
|
// TODO check if accountID is on blacklist
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -80,8 +80,8 @@ public class TradeService {
|
||||||
|
|
||||||
private final NetworkParameters params;
|
private final NetworkParameters params;
|
||||||
private final Wallet wallet;
|
private final Wallet wallet;
|
||||||
private WalletAppKit walletAppKit;
|
private final WalletAppKit walletAppKit;
|
||||||
private FeePolicy feePolicy;
|
private final FeePolicy feePolicy;
|
||||||
|
|
||||||
public TradeService(NetworkParameters params, Wallet wallet, WalletAppKit walletAppKit, FeePolicy feePolicy) {
|
public TradeService(NetworkParameters params, Wallet wallet, WalletAppKit walletAppKit, FeePolicy feePolicy) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
|
@ -136,7 +136,7 @@ public class TradeService {
|
||||||
// Trade
|
// Trade
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public TransactionDataResult offererCreatesDepositTxInputs(Coin inputAmount, AddressEntry addressInfo) throws InsufficientMoneyException,
|
public TransactionDataResult offererCreatesDepositTxInputs(Coin inputAmount, AddressEntry addressInfo) throws
|
||||||
TransactionVerificationException, WalletException {
|
TransactionVerificationException, WalletException {
|
||||||
|
|
||||||
// We pay the tx fee 2 times to the deposit tx:
|
// We pay the tx fee 2 times to the deposit tx:
|
||||||
|
@ -199,7 +199,7 @@ public class TradeService {
|
||||||
AddressEntry addressInfo,
|
AddressEntry addressInfo,
|
||||||
byte[] offererPubKey,
|
byte[] offererPubKey,
|
||||||
byte[] takerPubKey,
|
byte[] takerPubKey,
|
||||||
byte[] arbitratorPubKey) throws InsufficientMoneyException, SigningException,
|
byte[] arbitratorPubKey) throws SigningException,
|
||||||
TransactionVerificationException, WalletException {
|
TransactionVerificationException, WalletException {
|
||||||
|
|
||||||
checkArgument(offererConnectedOutputsForAllInputs.size() > 0);
|
checkArgument(offererConnectedOutputsForAllInputs.size() > 0);
|
||||||
|
@ -308,7 +308,6 @@ public class TradeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add taker inputs and apply signature
|
// Add taker inputs and apply signature
|
||||||
List<TransactionInput> takerInputs = new ArrayList<>();
|
|
||||||
for (TransactionOutput connectedOutputForInput : takerConnectedOutputsForAllInputs) {
|
for (TransactionOutput connectedOutputForInput : takerConnectedOutputsForAllInputs) {
|
||||||
TransactionOutPoint outPoint = new TransactionOutPoint(params, connectedOutputForInput.getIndex(), connectedOutputForInput.getParentTransaction());
|
TransactionOutPoint outPoint = new TransactionOutPoint(params, connectedOutputForInput.getIndex(), connectedOutputForInput.getParentTransaction());
|
||||||
|
|
||||||
|
@ -319,7 +318,6 @@ public class TradeService {
|
||||||
throw new TransactionVerificationException("Inputs from taker not singed.");
|
throw new TransactionVerificationException("Inputs from taker not singed.");
|
||||||
|
|
||||||
TransactionInput transactionInput = new TransactionInput(params, depositTx, scriptProgram, outPoint, connectedOutputForInput.getValue());
|
TransactionInput transactionInput = new TransactionInput(params, depositTx, scriptProgram, outPoint, connectedOutputForInput.getValue());
|
||||||
takerInputs.add(transactionInput);
|
|
||||||
depositTx.addInput(transactionInput);
|
depositTx.addInput(transactionInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +370,7 @@ public class TradeService {
|
||||||
Coin takerPayoutAmount,
|
Coin takerPayoutAmount,
|
||||||
String takerAddressString,
|
String takerAddressString,
|
||||||
AddressEntry addressEntry)
|
AddressEntry addressEntry)
|
||||||
throws AddressFormatException, TransactionVerificationException, WalletException {
|
throws AddressFormatException, TransactionVerificationException {
|
||||||
|
|
||||||
Transaction payoutTx = createPayoutTx(depositTx, offererPayoutAmount, takerPayoutAmount, addressEntry.getAddressString(), takerAddressString);
|
Transaction payoutTx = createPayoutTx(depositTx, offererPayoutAmount, takerPayoutAmount, addressEntry.getAddressString(), takerAddressString);
|
||||||
|
|
||||||
|
@ -442,7 +440,7 @@ public class TradeService {
|
||||||
return tx;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printTxWithInputs(String tracePrefix, Transaction tx) {
|
private static void printTxWithInputs(String tracePrefix, Transaction tx) {
|
||||||
log.trace(tracePrefix + ": " + tx.toString());
|
log.trace(tracePrefix + ": " + tx.toString());
|
||||||
for (TransactionInput input : tx.getInputs()) {
|
for (TransactionInput input : tx.getInputs()) {
|
||||||
if (input.getConnectedOutput() != null)
|
if (input.getConnectedOutput() != null)
|
||||||
|
@ -474,7 +472,7 @@ public class TradeService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void signInput(Transaction transaction, TransactionInput input, int inputIndex) throws SigningException, TransactionVerificationException {
|
private void signInput(Transaction transaction, TransactionInput input, int inputIndex) throws SigningException {
|
||||||
Script scriptPubKey = input.getConnectedOutput().getScriptPubKey();
|
Script scriptPubKey = input.getConnectedOutput().getScriptPubKey();
|
||||||
ECKey sigKey = input.getOutpoint().getConnectedKey(wallet);
|
ECKey sigKey = input.getOutpoint().getConnectedKey(wallet);
|
||||||
Sha256Hash hash = transaction.hashForSignature(inputIndex, scriptPubKey, Transaction.SigHash.ALL, false);
|
Sha256Hash hash = transaction.hashForSignature(inputIndex, scriptPubKey, Transaction.SigHash.ALL, false);
|
||||||
|
@ -510,7 +508,7 @@ public class TradeService {
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
private void removeSignatures(Transaction transaction) throws InsufficientMoneyException {
|
private void removeSignatures(Transaction transaction) {
|
||||||
for (TransactionInput input : transaction.getInputs()) {
|
for (TransactionInput input : transaction.getInputs()) {
|
||||||
input.setScriptSig(new Script(new byte[]{}));
|
input.setScriptSig(new Script(new byte[]{}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ public class WalletService {
|
||||||
wallet.addEventListener(walletEventListener);
|
wallet.addEventListener(walletEventListener);
|
||||||
|
|
||||||
Serializable serializable = persistence.read(this, "addressEntryList");
|
Serializable serializable = persistence.read(this, "addressEntryList");
|
||||||
if (serializable instanceof List) {
|
if (serializable instanceof List<?>) {
|
||||||
List<AddressEntry> persistedAddressEntryList = (List<AddressEntry>) serializable;
|
List<AddressEntry> persistedAddressEntryList = (List<AddressEntry>) serializable;
|
||||||
for (AddressEntry persistedAddressEntry : persistedAddressEntryList) {
|
for (AddressEntry persistedAddressEntry : persistedAddressEntryList) {
|
||||||
persistedAddressEntry.setDeterministicKey((DeterministicKey) wallet.findKeyFromPubHash(persistedAddressEntry.getPubKeyHash()));
|
persistedAddressEntry.setDeterministicKey((DeterministicKey) wallet.findKeyFromPubHash(persistedAddressEntry.getPubKeyHash()));
|
||||||
|
@ -355,9 +355,6 @@ public class WalletService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyConfidenceListeners(Transaction tx) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private TransactionConfidence getTransactionConfidence(Transaction tx, Address address) {
|
private TransactionConfidence getTransactionConfidence(Transaction tx, Address address) {
|
||||||
List<TransactionOutput> mergedOutputs = getOutputsWithConnectedOutputs(tx);
|
List<TransactionOutput> mergedOutputs = getOutputsWithConnectedOutputs(tx);
|
||||||
List<TransactionConfidence> transactionConfidenceList = new ArrayList<>();
|
List<TransactionConfidence> transactionConfidenceList = new ArrayList<>();
|
||||||
|
@ -412,6 +409,7 @@ public class WalletService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
public boolean isRegistrationFeeConfirmed() {
|
public boolean isRegistrationFeeConfirmed() {
|
||||||
TransactionConfidence transactionConfidence = null;
|
TransactionConfidence transactionConfidence = null;
|
||||||
if (getRegistrationAddressEntry() != null) {
|
if (getRegistrationAddressEntry() != null) {
|
||||||
|
@ -442,7 +440,7 @@ public class WalletService {
|
||||||
return balance;
|
return balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Coin getWalletBalance() {
|
Coin getWalletBalance() {
|
||||||
return wallet.getBalance(Wallet.BalanceType.ESTIMATED);
|
return wallet.getBalance(Wallet.BalanceType.ESTIMATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,16 +452,19 @@ public class WalletService {
|
||||||
return getBalanceForAddress(getArbitratorDepositAddressEntry().getAddress());
|
return getBalanceForAddress(getArbitratorDepositAddressEntry().getAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
public boolean isRegistrationFeeBalanceNonZero() {
|
public boolean isRegistrationFeeBalanceNonZero() {
|
||||||
return getRegistrationBalance().compareTo(Coin.ZERO) > 0;
|
return getRegistrationBalance().compareTo(Coin.ZERO) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
public boolean isRegistrationFeeBalanceSufficient() {
|
public boolean isRegistrationFeeBalanceSufficient() {
|
||||||
return getRegistrationBalance().compareTo(FeePolicy.REGISTRATION_FEE) >= 0;
|
return getRegistrationBalance().compareTo(FeePolicy.REGISTRATION_FEE) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
public int getNumOfPeersSeenTx(String txID) {
|
@SuppressWarnings("SameReturnValue")
|
||||||
|
public int getNumOfPeersSeenTx(String txId) {
|
||||||
// TODO check from blockchain
|
// TODO check from blockchain
|
||||||
// will be async
|
// will be async
|
||||||
return 3;
|
return 3;
|
||||||
|
@ -558,7 +559,7 @@ public class WalletService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printTxWithInputs(String tracePrefix, Transaction tx) {
|
private static void printTxWithInputs(String tracePrefix, Transaction tx) {
|
||||||
log.trace(tracePrefix + ": " + tx.toString());
|
log.trace(tracePrefix + ": " + tx.toString());
|
||||||
for (TransactionInput input : tx.getInputs()) {
|
for (TransactionInput input : tx.getInputs()) {
|
||||||
if (input.getConnectedOutput() != null)
|
if (input.getConnectedOutput() != null)
|
||||||
|
|
|
@ -21,14 +21,17 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class SigningException extends Exception {
|
public class SigningException extends Exception {
|
||||||
|
private static final long serialVersionUID = -4585301671813918976L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SigningException.class);
|
private static final Logger log = LoggerFactory.getLogger(SigningException.class);
|
||||||
|
|
||||||
public SigningException(String message) {
|
public SigningException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess")
|
||||||
public SigningException(Throwable t) {
|
public SigningException(Throwable t) {
|
||||||
super(t);
|
super(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class TransactionVerificationException extends Exception {
|
public class TransactionVerificationException extends Exception {
|
||||||
|
private static final long serialVersionUID = 4447301533313718296L;
|
||||||
private static final Logger log = LoggerFactory.getLogger(TransactionVerificationException.class);
|
private static final Logger log = LoggerFactory.getLogger(TransactionVerificationException.class);
|
||||||
|
|
||||||
public TransactionVerificationException(Throwable t) {
|
public TransactionVerificationException(Throwable t) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class WalletException extends Exception {
|
public class WalletException extends Exception {
|
||||||
|
private static final long serialVersionUID = 4782095361220152803L;
|
||||||
private static final Logger log = LoggerFactory.getLogger(WalletException.class);
|
private static final Logger log = LoggerFactory.getLogger(WalletException.class);
|
||||||
|
|
||||||
public WalletException(Throwable t) {
|
public WalletException(Throwable t) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ public class AddressConfidenceListener {
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedParameters")
|
||||||
public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
|
public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,6 +34,7 @@ public class BalanceListener {
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedParameters")
|
||||||
public void onBalanceChanged(Coin balance) {
|
public void onBalanceChanged(Coin balance) {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -30,6 +30,7 @@ public class TxConfidenceListener {
|
||||||
return txID;
|
return txID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedParameters")
|
||||||
public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
|
public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,10 +31,10 @@ import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessPayoutTxPublishedM
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessRequestOffererPublishDepositTxMessage;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessRequestOffererPublishDepositTxMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessRequestTakeOfferMessage;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessRequestTakeOfferMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessTakeOfferFeePayedMessage;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.ProcessTakeOfferFeePayedMessage;
|
||||||
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.RequestDepositPayment;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.RespondToTakeOfferRequest;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.RespondToTakeOfferRequest;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.SendBankTransferStartedMessage;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.SendBankTransferStartedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.SendDepositTxIdToTaker;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.SendDepositTxIdToTaker;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.RequestDepositPayment;
|
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.SetupListenerForBlockChainConfirmation;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.SetupListenerForBlockChainConfirmation;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.SignAndPublishDepositTx;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.SignAndPublishDepositTx;
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.SignPayoutTx;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.SignPayoutTx;
|
||||||
|
@ -43,18 +43,18 @@ import io.bitsquare.trade.protocol.trade.offerer.tasks.VerifyTakeOfferFeePayment
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.tasks.VerifyTakerAccount;
|
import io.bitsquare.trade.protocol.trade.offerer.tasks.VerifyTakerAccount;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.SellerAsTakerProtocol;
|
import io.bitsquare.trade.protocol.trade.taker.SellerAsTakerProtocol;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.CreateAndSignContract;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.CreateAndSignContract;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCreatesAndSignsDepositTx;
|
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.PayTakeOfferFee;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.PayTakeOfferFee;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessBankTransferStartedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessBankTransferStartedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessDepositTxPublishedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessDepositTxPublishedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessRespondToTakeOfferRequestMessage;
|
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessRequestDepositPaymentMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessRequestDepositPaymentMessage;
|
||||||
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessRespondToTakeOfferRequestMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.RequestTakeOffer;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.RequestTakeOffer;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SendPayoutTxToOfferer;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SendPayoutTxToOfferer;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SendSignedTakerDepositTx;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SendSignedTakerDepositTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SendTakeOfferFeePayedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SendTakeOfferFeePayedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SignAndPublishPayoutTx;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SignAndPublishPayoutTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCommitDepositTx;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCommitDepositTx;
|
||||||
|
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCreatesAndSignsDepositTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOfferFeePayment;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOfferFeePayment;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOffererAccount;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOffererAccount;
|
||||||
import io.bitsquare.util.taskrunner.Task;
|
import io.bitsquare.util.taskrunner.Task;
|
||||||
|
|
|
@ -2660,8 +2660,8 @@ is being used to size a border should also be in pixels.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header Sort Arrows */
|
/* Header Sort Arrows */
|
||||||
.table-view /*> column-header-background > nested-column-header >*/ .arrow,
|
.table-view /*> column-header-background > nested-column-header >*/ .arrow,
|
||||||
.tree-table-view /*> column-header-background > nested-column-header >*/ .arrow {
|
.tree-table-view /*> column-header-background > nested-column-header >*/ .arrow {
|
||||||
-fx-background-color: -fx-mark-color;
|
-fx-background-color: -fx-mark-color;
|
||||||
-fx-padding: 0.25em 0.3125em 0.25em 0.3125em; /* 3 3.75 3 3.75 */
|
-fx-padding: 0.25em 0.3125em 0.25em 0.3125em; /* 3 3.75 3 3.75 */
|
||||||
-fx-shape: "M 0 0 h 7 l -3.5 4 z";
|
-fx-shape: "M 0 0 h 7 l -3.5 4 z";
|
||||||
|
|
|
@ -103,17 +103,17 @@ public class TradeManager {
|
||||||
this.offerBookService = offerBookService;
|
this.offerBookService = offerBookService;
|
||||||
|
|
||||||
Object openOffersObject = persistence.read(this, "openOffers");
|
Object openOffersObject = persistence.read(this, "openOffers");
|
||||||
if (openOffersObject instanceof Map) {
|
if (openOffersObject instanceof Map<?, ?>) {
|
||||||
openOffers.putAll((Map<String, OpenOffer>) openOffersObject);
|
openOffers.putAll((Map<String, OpenOffer>) openOffersObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object pendingTradesObject = persistence.read(this, "pendingTrades");
|
Object pendingTradesObject = persistence.read(this, "pendingTrades");
|
||||||
if (pendingTradesObject instanceof Map) {
|
if (pendingTradesObject instanceof Map<?, ?>) {
|
||||||
pendingTrades.putAll((Map<String, Trade>) pendingTradesObject);
|
pendingTrades.putAll((Map<String, Trade>) pendingTradesObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object closedTradesObject = persistence.read(this, "closedTrades");
|
Object closedTradesObject = persistence.read(this, "closedTrades");
|
||||||
if (closedTradesObject instanceof Map) {
|
if (closedTradesObject instanceof Map<?, ?>) {
|
||||||
closedTrades.putAll((Map<String, Trade>) closedTradesObject);
|
closedTrades.putAll((Map<String, Trade>) closedTradesObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class CheckOfferAvailabilityProtocol {
|
||||||
// Incoming message handling
|
// Incoming message handling
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void handleMessage(Message message, @SuppressWarnings("UnusedParameters") Peer sender) {
|
private void handleMessage(Message message, Peer sender) {
|
||||||
if (!isCanceled) {
|
if (!isCanceled) {
|
||||||
if (message instanceof ReportOfferAvailabilityMessage)
|
if (message instanceof ReportOfferAvailabilityMessage)
|
||||||
handleReportOfferAvailabilityMessage((ReportOfferAvailabilityMessage) message);
|
handleReportOfferAvailabilityMessage((ReportOfferAvailabilityMessage) message);
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class ReportOfferAvailabilityMessage implements Serializable, OfferMessage {
|
public class ReportOfferAvailabilityMessage implements Serializable, OfferMessage {
|
||||||
private static final long serialVersionUID = 6177387534187739018L;
|
private static final long serialVersionUID = 6177387534187739018L;
|
||||||
|
|
||||||
private final String offerId;
|
private final String offerId;
|
||||||
private final boolean isOfferOpen;
|
private final boolean isOfferOpen;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.io.Serializable;
|
||||||
// That msg is used to ping the offerer if he is online and if the offer is still available
|
// That msg is used to ping the offerer if he is online and if the offer is still available
|
||||||
public class RequestIsOfferAvailableMessage implements Serializable, OfferMessage {
|
public class RequestIsOfferAvailableMessage implements Serializable, OfferMessage {
|
||||||
private static final long serialVersionUID = 4630151440192191798L;
|
private static final long serialVersionUID = 4630151440192191798L;
|
||||||
|
|
||||||
private final String offerId;
|
private final String offerId;
|
||||||
|
|
||||||
public RequestIsOfferAvailableMessage(String offerId) {
|
public RequestIsOfferAvailableMessage(String offerId) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class GetPeerAddress extends Task<CheckOfferAvailabilityModel> {
|
||||||
log.trace("Found peer: " + peer.toString());
|
log.trace("Found peer: " + peer.toString());
|
||||||
|
|
||||||
model.setPeer(peer);
|
model.setPeer(peer);
|
||||||
|
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class BankTransferStartedMessage implements Serializable, TradeMessage {
|
public class BankTransferStartedMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = -3479634129543632523L;
|
private static final long serialVersionUID = -3479634129543632523L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
private final Transaction depositTx;
|
private final Transaction depositTx;
|
||||||
private final byte[] offererSignature;
|
private final byte[] offererSignature;
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class DepositTxPublishedMessage implements Serializable, TradeMessage {
|
public class DepositTxPublishedMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = -1532231540167406581L;
|
private static final long serialVersionUID = -1532231540167406581L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
private final Transaction depositTx;
|
private final Transaction depositTx;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class RespondToTakeOfferRequestMessage implements Serializable, TradeMessage {
|
public class RespondToTakeOfferRequestMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = 6177387534087739018L;
|
private static final long serialVersionUID = 6177387534087739018L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
private final boolean offerIsAvailable;
|
private final boolean offerIsAvailable;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class GetOffererDepositTxInputs extends Task<BuyerAsOffererModel> {
|
||||||
Coin offererInputAmount = model.getTrade().getSecurityDeposit().add(FeePolicy.TX_FEE);
|
Coin offererInputAmount = model.getTrade().getSecurityDeposit().add(FeePolicy.TX_FEE);
|
||||||
AddressEntry addressInfo = model.getAddressEntry();
|
AddressEntry addressInfo = model.getAddressEntry();
|
||||||
TradeService.TransactionDataResult result = model.getTradeService().offererCreatesDepositTxInputs(offererInputAmount, addressInfo);
|
TradeService.TransactionDataResult result = model.getTradeService().offererCreatesDepositTxInputs(offererInputAmount, addressInfo);
|
||||||
|
|
||||||
model.setOffererConnectedOutputsForAllInputs(result.getConnectedOutputsForAllInputs());
|
model.setOffererConnectedOutputsForAllInputs(result.getConnectedOutputsForAllInputs());
|
||||||
model.setOffererOutputs(result.getOutputs());
|
model.setOffererOutputs(result.getOutputs());
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ProcessPayoutTxPublishedMessage extends Task<BuyerAsOffererModel> {
|
||||||
checkTradeId(model.getId(), model.getTradeMessage());
|
checkTradeId(model.getId(), model.getTradeMessage());
|
||||||
|
|
||||||
model.getTrade().setPayoutTx(checkNotNull(((PayoutTxPublishedMessage) model.getTradeMessage()).getPayoutTx()));
|
model.getTrade().setPayoutTx(checkNotNull(((PayoutTxPublishedMessage) model.getTradeMessage()).getPayoutTx()));
|
||||||
|
|
||||||
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
|
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
|
||||||
|
|
||||||
complete();
|
complete();
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class RespondToTakeOfferRequest extends Task<BuyerAsOffererModel> {
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() {
|
protected void doRun() {
|
||||||
offerIsAvailable = model.getOpenOffer().getState() == OpenOffer.State.OPEN;
|
offerIsAvailable = model.getOpenOffer().getState() == OpenOffer.State.OPEN;
|
||||||
|
|
||||||
if (offerIsAvailable) {
|
if (offerIsAvailable) {
|
||||||
Trade trade = new Trade(model.getOpenOffer().getOffer());
|
Trade trade = new Trade(model.getOpenOffer().getOffer());
|
||||||
model.setTrade(trade);
|
model.setTrade(trade);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SetupListenerForBlockChainConfirmation extends Task<BuyerAsOffererM
|
||||||
model.getTrade().setState(Trade.State.DEPOSIT_CONFIRMED);
|
model.getTrade().setState(Trade.State.DEPOSIT_CONFIRMED);
|
||||||
|
|
||||||
boolean removed = confidence.removeEventListener(this);
|
boolean removed = confidence.removeEventListener(this);
|
||||||
log.debug("listener removed? "+removed);
|
log.debug("listener removed? " + removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,7 +28,6 @@ import io.bitsquare.trade.protocol.trade.offerer.messages.RequestDepositPaymentM
|
||||||
import io.bitsquare.trade.protocol.trade.offerer.messages.RespondToTakeOfferRequestMessage;
|
import io.bitsquare.trade.protocol.trade.offerer.messages.RespondToTakeOfferRequestMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.CreateAndSignContract;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.CreateAndSignContract;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.GetPeerAddress;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.GetPeerAddress;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCreatesAndSignsDepositTx;
|
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.PayTakeOfferFee;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.PayTakeOfferFee;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessBankTransferStartedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessBankTransferStartedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessDepositTxPublishedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.ProcessDepositTxPublishedMessage;
|
||||||
|
@ -40,6 +39,7 @@ import io.bitsquare.trade.protocol.trade.taker.tasks.SendSignedTakerDepositTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SendTakeOfferFeePayedMessage;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SendTakeOfferFeePayedMessage;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.SignAndPublishPayoutTx;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.SignAndPublishPayoutTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCommitDepositTx;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCommitDepositTx;
|
||||||
|
import io.bitsquare.trade.protocol.trade.taker.tasks.TakerCreatesAndSignsDepositTx;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOfferFeePayment;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOfferFeePayment;
|
||||||
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOffererAccount;
|
import io.bitsquare.trade.protocol.trade.taker.tasks.VerifyOffererAccount;
|
||||||
|
|
||||||
|
@ -196,12 +196,12 @@ public class SellerAsTakerProtocol {
|
||||||
// Massage dispatcher
|
// Massage dispatcher
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void handleMessage(Message message, @SuppressWarnings("UnusedParameters") Peer sender) {
|
private void handleMessage(Message message, Peer sender) {
|
||||||
log.trace("handleNewMessage: message = " + message.getClass().getSimpleName());
|
log.trace("handleNewMessage: message = " + message.getClass().getSimpleName());
|
||||||
if (message instanceof TradeMessage) {
|
if (message instanceof TradeMessage) {
|
||||||
TradeMessage tradeMessage = (TradeMessage) message;
|
TradeMessage tradeMessage = (TradeMessage) message;
|
||||||
nonEmptyStringOf(tradeMessage.getTradeId());
|
nonEmptyStringOf(tradeMessage.getTradeId());
|
||||||
|
|
||||||
if (tradeMessage.getTradeId().equals(model.getOffer().getId())) {
|
if (tradeMessage.getTradeId().equals(model.getOffer().getId())) {
|
||||||
if (tradeMessage instanceof RespondToTakeOfferRequestMessage) {
|
if (tradeMessage instanceof RespondToTakeOfferRequestMessage) {
|
||||||
handleRespondToTakeOfferRequestMessage((RespondToTakeOfferRequestMessage) tradeMessage);
|
handleRespondToTakeOfferRequestMessage((RespondToTakeOfferRequestMessage) tradeMessage);
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class PayoutTxPublishedMessage implements Serializable, TradeMessage {
|
public class PayoutTxPublishedMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = 1288653559218403873L;
|
private static final long serialVersionUID = 1288653559218403873L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
private final Transaction payoutTx;
|
private final Transaction payoutTx;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class RequestTakeOfferMessage implements Serializable, TradeMessage {
|
public class RequestTakeOfferMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = 4660151440192191798L;
|
private static final long serialVersionUID = 4660151440192191798L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
|
|
||||||
public RequestTakeOfferMessage(String tradeId) {
|
public RequestTakeOfferMessage(String tradeId) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class TakeOfferFeePayedMessage implements Serializable, TradeMessage {
|
public class TakeOfferFeePayedMessage implements Serializable, TradeMessage {
|
||||||
private static final long serialVersionUID = -5057935061275354312L;
|
private static final long serialVersionUID = -5057935061275354312L;
|
||||||
|
|
||||||
private final String tradeId;
|
private final String tradeId;
|
||||||
private final Coin tradeAmount;
|
private final Coin tradeAmount;
|
||||||
private final String takeOfferFeeTxID;
|
private final String takeOfferFeeTxID;
|
||||||
|
|
|
@ -43,14 +43,14 @@ public class GetPeerAddress extends Task<SellerAsTakerModel> {
|
||||||
log.trace("Found peer: " + peer.toString());
|
log.trace("Found peer: " + peer.toString());
|
||||||
|
|
||||||
model.setOfferer(peer);
|
model.setOfferer(peer);
|
||||||
|
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed() {
|
public void onFailed() {
|
||||||
model.getOffer().setState(Offer.State.OFFERER_OFFLINE);
|
model.getOffer().setState(Offer.State.OFFERER_OFFLINE);
|
||||||
|
|
||||||
failed();
|
failed();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static io.bitsquare.util.Validator.*;
|
import static io.bitsquare.util.Validator.checkTradeId;
|
||||||
|
|
||||||
public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
|
public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ProcessDepositTxPublishedMessage.class);
|
private static final Logger log = LoggerFactory.getLogger(ProcessDepositTxPublishedMessage.class);
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ProcessRequestDepositPaymentMessage extends Task<SellerAsTakerModel
|
||||||
checkArgument(message.getOffererConnectedOutputsForAllInputs().size() > 0);
|
checkArgument(message.getOffererConnectedOutputsForAllInputs().size() > 0);
|
||||||
model.setOffererOutputs(checkNotNull(message.getOffererOutputs()));
|
model.setOffererOutputs(checkNotNull(message.getOffererOutputs()));
|
||||||
model.setOffererPubKey(checkNotNull(message.getOffererPubKey()));
|
model.setOffererPubKey(checkNotNull(message.getOffererPubKey()));
|
||||||
|
|
||||||
model.setTakerBankAccount(checkNotNull(message.getBankAccount()));
|
model.setTakerBankAccount(checkNotNull(message.getBankAccount()));
|
||||||
model.setTakerAccountId(nonEmptyStringOf(message.getAccountId()));
|
model.setTakerAccountId(nonEmptyStringOf(message.getAccountId()));
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class TakerCreatesAndSignsDepositTx extends Task<SellerAsTakerModel> {
|
||||||
model.getTakerPubKey(),
|
model.getTakerPubKey(),
|
||||||
model.getArbitratorPubKey());
|
model.getArbitratorPubKey());
|
||||||
|
|
||||||
|
|
||||||
model.setTakerConnectedOutputsForAllInputs(result.getConnectedOutputsForAllInputs());
|
model.setTakerConnectedOutputsForAllInputs(result.getConnectedOutputsForAllInputs());
|
||||||
model.setTakerOutputs(result.getOutputs());
|
model.setTakerOutputs(result.getOutputs());
|
||||||
model.setTakerDepositTx(result.getDepositTx());
|
model.setTakerDepositTx(result.getDepositTx());
|
||||||
|
|
|
@ -20,7 +20,6 @@ package io.bitsquare.trade.tomp2p;
|
||||||
import io.bitsquare.network.tomp2p.TomP2PNode;
|
import io.bitsquare.network.tomp2p.TomP2PNode;
|
||||||
import io.bitsquare.trade.TradeMessageModule;
|
import io.bitsquare.trade.TradeMessageModule;
|
||||||
import io.bitsquare.trade.TradeMessageService;
|
import io.bitsquare.trade.TradeMessageService;
|
||||||
import io.bitsquare.user.User;
|
|
||||||
|
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
@ -47,8 +46,8 @@ class TomP2PTradeMessageServiceProvider implements Provider<TradeMessageService>
|
||||||
private final TradeMessageService tradeMessageService;
|
private final TradeMessageService tradeMessageService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TomP2PTradeMessageServiceProvider(User user, TomP2PNode tomP2PNode) {
|
public TomP2PTradeMessageServiceProvider(TomP2PNode tomP2PNode) {
|
||||||
tradeMessageService = new TomP2PTradeMessageService(user, tomP2PNode);
|
tradeMessageService = new TomP2PTradeMessageService(tomP2PNode);
|
||||||
tradeMessageService.setExecutor(Platform::runLater);
|
tradeMessageService.setExecutor(Platform::runLater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ import io.bitsquare.trade.TradeMessageService;
|
||||||
import io.bitsquare.trade.handlers.MessageHandler;
|
import io.bitsquare.trade.handlers.MessageHandler;
|
||||||
import io.bitsquare.trade.listeners.GetPeerAddressListener;
|
import io.bitsquare.trade.listeners.GetPeerAddressListener;
|
||||||
import io.bitsquare.trade.listeners.SendMessageListener;
|
import io.bitsquare.trade.listeners.SendMessageListener;
|
||||||
import io.bitsquare.user.User;
|
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ public class TomP2PTradeMessageService implements TradeMessageService {
|
||||||
// Constructor
|
// Constructor
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public TomP2PTradeMessageService(User user, TomP2PNode tomP2PNode) {
|
public TomP2PTradeMessageService(TomP2PNode tomP2PNode) {
|
||||||
this.tomP2PNode = tomP2PNode;
|
this.tomP2PNode = tomP2PNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class PlaceOfferProtocolTest {
|
||||||
user.applyPersistedUser(null);
|
user.applyPersistedUser(null);
|
||||||
bootstrappedPeerBuilder = new BootstrappedPeerBuilder(Node.DEFAULT_PORT, false, bootstrapNode, "<unspecified>");
|
bootstrappedPeerBuilder = new BootstrappedPeerBuilder(Node.DEFAULT_PORT, false, bootstrapNode, "<unspecified>");
|
||||||
tomP2PNode = new TomP2PNode(bootstrappedPeerBuilder);
|
tomP2PNode = new TomP2PNode(bootstrappedPeerBuilder);
|
||||||
tradeMessageService = new TomP2PTradeMessageService(user, tomP2PNode);
|
tradeMessageService = new TomP2PTradeMessageService(tomP2PNode);
|
||||||
|
|
||||||
Observable<BootstrapState> messageObservable = tomP2PNode.bootstrap(user.getNetworkKeyPair(), tradeMessageService);
|
Observable<BootstrapState> messageObservable = tomP2PNode.bootstrap(user.getNetworkKeyPair(), tradeMessageService);
|
||||||
messageObservable.publish();
|
messageObservable.publish();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue