diff --git a/src/main/java/co/rsk/bitcoinj/script/Script.java b/src/main/java/co/rsk/bitcoinj/script/Script.java index dffab60cc..ff7aa764b 100644 --- a/src/main/java/co/rsk/bitcoinj/script/Script.java +++ b/src/main/java/co/rsk/bitcoinj/script/Script.java @@ -96,7 +96,7 @@ public enum VerifyFlag { private static final Logger log = LoggerFactory.getLogger(Script.class); public static final long MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes - public static final int SIG_SIZE = 75; + public static final int SIG_SIZE = 73; /** Max number of sigops allowed in a standard p2sh redeem script */ public static final int MAX_P2SH_SIGOPS = 15; diff --git a/src/main/java/co/rsk/bitcoinj/wallet/SendRequest.java b/src/main/java/co/rsk/bitcoinj/wallet/SendRequest.java index 400eaa89a..2ad9b07a6 100644 --- a/src/main/java/co/rsk/bitcoinj/wallet/SendRequest.java +++ b/src/main/java/co/rsk/bitcoinj/wallet/SendRequest.java @@ -60,6 +60,8 @@ public class SendRequest { */ public BtcTransaction tx; + public boolean isSegwit = false; + /** * When emptyWallet is set, all coins selected by the coin selector are sent to the first output in tx * (its value is ignored and set to {@link co.rsk.bitcoinj.wallet.Wallet#getBalance()} - the fees required diff --git a/src/main/java/co/rsk/bitcoinj/wallet/Wallet.java b/src/main/java/co/rsk/bitcoinj/wallet/Wallet.java index 9b439501b..6fc7f2afa 100644 --- a/src/main/java/co/rsk/bitcoinj/wallet/Wallet.java +++ b/src/main/java/co/rsk/bitcoinj/wallet/Wallet.java @@ -996,8 +996,22 @@ public FeeCalculation calculateFee(SendRequest req, Coin value, List originalInputs) { for (TransactionInput input : originalInputs) tx.addInput(new TransactionInput(params, tx, input.bitcoinSerialize()));