From 22ba9a898b5ad4db64f4cc1f3089347afbb5a6c0 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 6 Oct 2020 16:31:20 -0300 Subject: [PATCH] Explain why bitcoinSerialize(false) is used --- .../main/java/bisq/core/btc/wallet/TradeWalletService.java | 4 ++++ 1 file changed, 4 insertions(+) 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 7f6c28007b..0c0f4284be 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java @@ -1171,6 +1171,10 @@ public class TradeWalletService { "input.getConnectedOutput().getParentTransaction() must not be null"); checkNotNull(input.getValue(), "input.getValue() must not be null"); + // bitcoinSerialize(false) is used just in case the serialized tx is parsed by a bisq node still using + // bitcoinj 0.14. This is not supposed to happen ever since Version.TRADE_PROTOCOL_VERSION was set to 3, + // but it costs nothing to be on the safe side. + // The serialized tx is just used to obtain its hash, so the witness data is not relevant. return new RawTransactionInput(input.getOutpoint().getIndex(), input.getConnectedOutput().getParentTransaction().bitcoinSerialize(false), input.getValue().value);