From aa06253b1683782865a474703fc9ee634a39e736 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Wed, 23 Dec 2020 15:49:16 -0500 Subject: [PATCH 1/3] Remove unused code --- .../java/bisq/core/btc/wallet/TradeWalletService.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java index 8d03f8488da..4244e78534e 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java @@ -1111,15 +1111,7 @@ public Tuple2 emergencyBuildPayoutTxFrom2of2MultiSig(String depo byte[] buyerPubKey = ECKey.fromPublicOnly(Utils.HEX.decode(buyerPubKeyAsHex)).getPubKey(); byte[] sellerPubKey = ECKey.fromPublicOnly(Utils.HEX.decode(sellerPubKeyAsHex)).getPubKey(); Script redeemScript = get2of2MultiSigRedeemScript(buyerPubKey, sellerPubKey); - - Script hashedMultiSigOutputScript = get2of2MultiSigOutputScript(buyerPubKey, sellerPubKey, - hashedMultiSigOutputIsLegacy); - Coin msOutputValue = buyerPayoutAmount.add(sellerPayoutAmount).add(txFee); - TransactionOutput hashedMultiSigOutput = new TransactionOutput(params, null, msOutputValue, hashedMultiSigOutputScript.getProgram()); - Transaction depositTx = new Transaction(params); - depositTx.addOutput(hashedMultiSigOutput); - Transaction payoutTx = new Transaction(params); Sha256Hash spendTxHash = Sha256Hash.wrap(depositTxHex); payoutTx.addInput(new TransactionInput(params, payoutTx, new byte[]{}, new TransactionOutPoint(params, 0, spendTxHash), msOutputValue)); From 0c792a2916c2186b48502cc008956300ef2b9727 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Wed, 23 Dec 2020 16:15:15 -0500 Subject: [PATCH 2/3] Add comments to make context of parentTx more clear --- .../java/bisq/core/btc/model/RawTransactionInput.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java b/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java index ef4d52116cb..a7ba9b61a63 100644 --- a/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java +++ b/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java @@ -27,12 +27,16 @@ import javax.annotation.concurrent.Immutable; +/** + * Holds the relevant data for the connected output for a tx input. + * ParentTransaction means here the spending tx, the tx of the output not the parentTransaction of the input itself. + * Also index refers to the index of the spending output + */ @EqualsAndHashCode @Immutable public final class RawTransactionInput implements NetworkPayload, PersistablePayload { - // Payload - public final long index; - public final byte[] parentTransaction; + public final long index; // Index of spending txo + public final byte[] parentTransaction; // Spending tx (fromTx) public final long value; public RawTransactionInput(long index, byte[] parentTransaction, long value) { From 62ca82621729ce942e64610fe52d4abc50335ef7 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Sat, 26 Dec 2020 19:47:57 -0500 Subject: [PATCH 3/3] Use java doc at constructor --- .../java/bisq/core/btc/model/RawTransactionInput.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java b/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java index a7ba9b61a63..3a59ab07f9c 100644 --- a/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java +++ b/core/src/main/java/bisq/core/btc/model/RawTransactionInput.java @@ -27,11 +27,6 @@ import javax.annotation.concurrent.Immutable; -/** - * Holds the relevant data for the connected output for a tx input. - * ParentTransaction means here the spending tx, the tx of the output not the parentTransaction of the input itself. - * Also index refers to the index of the spending output - */ @EqualsAndHashCode @Immutable public final class RawTransactionInput implements NetworkPayload, PersistablePayload { @@ -39,6 +34,12 @@ public final class RawTransactionInput implements NetworkPayload, PersistablePay public final byte[] parentTransaction; // Spending tx (fromTx) public final long value; + /** + * Holds the relevant data for the connected output for a tx input. + * @param index the index of the parentTransaction + * @param parentTransaction the spending output tx, not the parent tx of the input + * @param value the number of satoshis being spent + */ public RawTransactionInput(long index, byte[] parentTransaction, long value) { this.index = index; this.parentTransaction = parentTransaction;