diff --git a/core/src/main/java/io/bitsquare/app/BitsquareEnvironment.java b/core/src/main/java/io/bitsquare/app/BitsquareEnvironment.java index a6ba8abdf5..04487e7329 100644 --- a/core/src/main/java/io/bitsquare/app/BitsquareEnvironment.java +++ b/core/src/main/java/io/bitsquare/app/BitsquareEnvironment.java @@ -62,7 +62,8 @@ public class BitsquareEnvironment extends StandardEnvironment { public static final String DEFAULT_USER_DATA_DIR = defaultUserDataDir(); public static final String DEFAULT_APP_DATA_DIR = appDataDir(DEFAULT_USER_DATA_DIR, DEFAULT_APP_NAME); - public static final String LOG_LEVEL_DEFAULT = (DevFlags.STRESS_TEST_MODE || DevFlags.DEV_MODE) ? Level.TRACE.levelStr : Level.INFO.levelStr; + //public static final String LOG_LEVEL_DEFAULT = (DevFlags.STRESS_TEST_MODE || DevFlags.DEV_MODE) ? Level.TRACE.levelStr : Level.INFO.levelStr; + public static final String LOG_LEVEL_DEFAULT = Level.INFO.levelStr; static final String BITSQUARE_COMMANDLINE_PROPERTY_SOURCE_NAME = "bitsquareCommandLineProperties"; static final String BITSQUARE_APP_DIR_PROPERTY_SOURCE_NAME = "bitsquareAppDirProperties"; diff --git a/core/src/main/java/io/bitsquare/btc/TradeWalletService.java b/core/src/main/java/io/bitsquare/btc/TradeWalletService.java index ead2649045..aabb4e9ece 100644 --- a/core/src/main/java/io/bitsquare/btc/TradeWalletService.java +++ b/core/src/main/java/io/bitsquare/btc/TradeWalletService.java @@ -683,16 +683,16 @@ public class TradeWalletService { * @throws AddressFormatException * @throws TransactionVerificationException */ - public byte[] signDisputedPayoutTx(byte[] depositTxSerialized, - Coin buyerPayoutAmount, - Coin sellerPayoutAmount, - Coin arbitratorPayoutAmount, - String buyerAddressString, - String sellerAddressString, - AddressEntry arbitratorAddressEntry, - byte[] buyerPubKey, - byte[] sellerPubKey, - byte[] arbitratorPubKey) + public byte[] arbitratorSignsDisputedPayoutTx(byte[] depositTxSerialized, + Coin buyerPayoutAmount, + Coin sellerPayoutAmount, + Coin arbitratorPayoutAmount, + String buyerAddressString, + String sellerAddressString, + AddressEntry arbitratorAddressEntry, + byte[] buyerPubKey, + byte[] sellerPubKey, + byte[] arbitratorPubKey) throws AddressFormatException, TransactionVerificationException { Transaction depositTx = new Transaction(params, depositTxSerialized); log.trace("signDisputedPayoutTx called"); @@ -847,24 +847,23 @@ public class TradeWalletService { List sellerPubKeys, FutureCallback callback) throws AddressFormatException, TransactionVerificationException, WalletException { - log.trace("signAndPublishPayoutTx called"); - log.trace("depositTxHex " + depositTxHex); - log.trace("buyerPayoutAmount " + buyerPayoutAmount.toFriendlyString()); - log.trace("sellerPayoutAmount " + sellerPayoutAmount.toFriendlyString()); - log.trace("arbitratorPayoutAmount " + arbitratorPayoutAmount.toFriendlyString()); - log.trace("buyerAddressString " + buyerAddressString); - log.trace("sellerAddressString " + sellerAddressString); - log.trace("arbitratorAddressString " + arbitratorAddressString); - log.trace("buyerPrivateKeyAsHex " + buyerPrivateKeyAsHex); - log.trace("sellerPrivateKeyAsHex " + sellerPrivateKeyAsHex); - log.trace("arbitratorPrivateKeyAsHex " + arbitratorPrivateKeyAsHex); - log.trace("buyerPubKeyAsHex " + buyerPubKeyAsHex); - log.trace("sellerPubKeyAsHex " + sellerPubKeyAsHex); - log.trace("arbitratorPubKeyAsHex " + arbitratorPubKeyAsHex); - - log.trace("P2SHMultiSigOutputScript " + P2SHMultiSigOutputScript); - log.trace("buyerPubKeys " + buyerPubKeys); - log.trace("sellerPubKeys " + sellerPubKeys); + log.info("signAndPublishPayoutTx called"); + log.info("depositTxHex " + depositTxHex); + log.info("buyerPayoutAmount " + buyerPayoutAmount.toFriendlyString()); + log.info("sellerPayoutAmount " + sellerPayoutAmount.toFriendlyString()); + log.info("arbitratorPayoutAmount " + arbitratorPayoutAmount.toFriendlyString()); + log.info("buyerAddressString " + buyerAddressString); + log.info("sellerAddressString " + sellerAddressString); + log.info("arbitratorAddressString " + arbitratorAddressString); + log.info("buyerPrivateKeyAsHex " + buyerPrivateKeyAsHex); + log.info("sellerPrivateKeyAsHex " + sellerPrivateKeyAsHex); + log.info("arbitratorPrivateKeyAsHex " + arbitratorPrivateKeyAsHex); + log.info("buyerPubKeyAsHex " + buyerPubKeyAsHex); + log.info("sellerPubKeyAsHex " + sellerPubKeyAsHex); + log.info("arbitratorPubKeyAsHex " + arbitratorPubKeyAsHex); + log.info("P2SHMultiSigOutputScript " + P2SHMultiSigOutputScript); + log.info("buyerPubKeys " + buyerPubKeys); + log.info("sellerPubKeys " + sellerPubKeys); checkNotNull((buyerPrivateKeyAsHex != null || sellerPrivateKeyAsHex != null), "either buyerPrivateKeyAsHex or sellerPrivateKeyAsHex must not be null"); @@ -889,8 +888,8 @@ public class TradeWalletService { byte[] sk = ECKey.fromPublicOnly(Utils.HEX.decode(s)).getPubKey(); p2SHMultiSigOutputScript = getP2SHMultiSigOutputScript(bk, sk, arbitratorPubKey); if (p2SHMultiSigOutputScript.toString().contains(P2SHMultiSigOutputScript)) { - log.trace("Found buyers pub key " + b); - log.trace("Found sellers pub key " + s); + log.info("Found buyers pub key " + b); + log.info("Found sellers pub key " + s); buyerPubKey = ECKey.fromPublicOnly(Utils.HEX.decode(b)).getPubKey(); sellerPubKey = ECKey.fromPublicOnly(Utils.HEX.decode(s)).getPubKey(); found = true; diff --git a/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/DisputeSummaryWindow.java b/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/DisputeSummaryWindow.java index a755811634..a8b21669fc 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/DisputeSummaryWindow.java +++ b/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/DisputeSummaryWindow.java @@ -598,7 +598,7 @@ public class DisputeSummaryWindow extends Overlay { byte[] sellerPubKey, byte[] arbitratorPubKey) */ - byte[] arbitratorSignature = tradeWalletService.signDisputedPayoutTx( + byte[] arbitratorSignature = tradeWalletService.arbitratorSignsDisputedPayoutTx( dispute.getDepositTxSerialized(), disputeResult.getBuyerPayoutAmount(), disputeResult.getSellerPayoutAmount(), diff --git a/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/SpendFromDepositTxWindow.java b/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/SpendFromDepositTxWindow.java index 9bbaa6391f..c5f7d8b72f 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/SpendFromDepositTxWindow.java +++ b/gui/src/main/java/io/bitsquare/gui/main/overlays/windows/SpendFromDepositTxWindow.java @@ -34,6 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -106,16 +107,17 @@ public class SpendFromDepositTxWindow extends Overlay InputTextField buyerPubKeysInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "buyerPubKeys:").second; InputTextField sellerPubKeysInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "sellerPubKeys:").second; - List buyerPubKeys = Arrays.asList(buyerPubKeysInputTextField.getText().split(",")); - List sellerPubKeys = Arrays.asList(sellerPubKeysInputTextField.getText().split(",")); - - /* + List buyerPubKeys = !buyerPubKeysInputTextField.getText().isEmpty() ? Arrays.asList(buyerPubKeysInputTextField.getText().split(",")) : new ArrayList<>(); + List sellerPubKeys = !sellerPubKeysInputTextField.getText().isEmpty() ? Arrays.asList(sellerPubKeysInputTextField.getText().split(",")) : new ArrayList<>(); + + + /* depositTxHex.setText(""); - buyerPayoutAmount.setText("1.01"); + buyerPayoutAmount.setText("0.01"); sellerPayoutAmount.setText("0.01"); arbitratorPayoutAmount.setText("0"); - + buyerAddressString.setText(""); buyerPubKeyAsHex.setText(""); buyerPrivateKeyAsHex.setText(""); @@ -123,22 +125,26 @@ public class SpendFromDepositTxWindow extends Overlay sellerAddressString.setText(""); sellerPubKeyAsHex.setText(""); sellerPrivateKeyAsHex.setText(""); - - arbitratorAddressString.setText("19xdeiQM2Hn2M2wbpT5imcYWzqhiSDHPy4"); - arbitratorPubKeyAsHex.setText("02c62e794fe67f3a2115e2de4757143ff7f27bdf38aa4ae58a3595baa6d676875b"); - - arbitratorAddressString.setText("1FdFzBazmHQxbUbdCUJwuCtR37DrZrEobu"); - arbitratorPubKeyAsHex.setText("030fdc2ebc297df4047442f6079f1ce3b7d1938a41f88bd11497545cc94fcfd315"); - + + //4.9 + // arbitratorAddressString.setText("19xdeiQM2Hn2M2wbpT5imcYWzqhiSDHPy4"); + // arbitratorPubKeyAsHex.setText("02c62e794fe67f3a2115e2de4757143ff7f27bdf38aa4ae58a3595baa6d676875b"); + + // 4.2 + arbitratorAddressString.setText("1FdFzBazmHQxbUbdCUJwuCtR37DrZrEobu"); + arbitratorPubKeyAsHex.setText("030fdc2ebc297df4047442f6079f1ce3b7d1938a41f88bd11497545cc94fcfd315"); + P2SHMultiSigOutputScript.setText(""); sellerPubKeys = Arrays.asList(); + + buyerPubKeys = Arrays.asList(); */ - actionButtonText("Sign and publish transaction"); final List finalSellerPubKeys = sellerPubKeys; + final List finalBuyerPubKeys = buyerPubKeys; FutureCallback callback = new FutureCallback() { @Override public void onSuccess(@Nullable Transaction result) { @@ -174,7 +180,7 @@ public class SpendFromDepositTxWindow extends Overlay sellerPubKeyAsHex.getText(), arbitratorPubKeyAsHex.getText(), P2SHMultiSigOutputScript.getText(), - buyerPubKeys, + finalBuyerPubKeys, finalSellerPubKeys, callback); } catch (AddressFormatException | WalletException | TransactionVerificationException e) {