From d0da764aadfc9edc2a7fb35540eca0ee4c20ba0f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 23 Feb 2023 11:59:47 +0200 Subject: [PATCH] add bsms model, additional taproot signing check --- .../com/sparrowwallet/drongo/protocol/Transaction.java | 8 ++++---- .../java/com/sparrowwallet/drongo/wallet/WalletModel.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/protocol/Transaction.java b/src/main/java/com/sparrowwallet/drongo/protocol/Transaction.java index d978ab1..25f0102 100644 --- a/src/main/java/com/sparrowwallet/drongo/protocol/Transaction.java +++ b/src/main/java/com/sparrowwallet/drongo/protocol/Transaction.java @@ -8,10 +8,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; +import java.util.*; import static com.sparrowwallet.drongo.Utils.uint32ToByteStreamLE; import static com.sparrowwallet.drongo.Utils.uint64ToByteStreamLE; @@ -634,6 +631,9 @@ public class Transaction extends ChildMessage { if(spentUtxos.size() != getInputs().size()) { throw new IllegalArgumentException("Provided spent UTXOs length does not equal the number of transaction inputs"); } + if(spentUtxos.stream().anyMatch(Objects::isNull)) { + throw new IllegalArgumentException("Not all spent UTXOs are provided"); + } if(inputIndex >= getInputs().size()) { throw new IllegalArgumentException("Input index is greater than the number of transaction inputs"); } diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java b/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java index fcb4234..49b56a4 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/WalletModel.java @@ -4,7 +4,7 @@ import java.util.Locale; public enum WalletModel { SEED, SPARROW, BITCOIN_CORE, ELECTRUM, TREZOR_1, TREZOR_T, COLDCARD, LEDGER_NANO_S, LEDGER_NANO_X, DIGITALBITBOX_01, KEEPKEY, SPECTER_DESKTOP, COBO_VAULT, - BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS; + BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS, BSMS; public static WalletModel getModel(String model) { return valueOf(model.toUpperCase(Locale.ROOT));