mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 18:16:45 +00:00
handle finalized psbts
This commit is contained in:
parent
72a2a8bd1b
commit
958d9c5274
1 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ import java.util.stream.IntStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a special wallet that is used solely to finalize a fully signed PSBT by reading from the partial signatures and UTXO scriptPubKey
|
* This is a special wallet that is used solely to finalize a fully signed PSBT by reading from the partial signatures and UTXO scriptPubKey
|
||||||
* It is used when the normal wallet is not available.
|
* It is used when the normal wallet is not available, for example when the wallet file is kept in an offline only setting
|
||||||
*/
|
*/
|
||||||
public class FinalizingPSBTWallet extends Wallet {
|
public class FinalizingPSBTWallet extends Wallet {
|
||||||
private final Map<PSBTInput, WalletNode> signedInputNodes = new LinkedHashMap<>();
|
private final Map<PSBTInput, WalletNode> signedInputNodes = new LinkedHashMap<>();
|
||||||
|
@ -28,8 +28,8 @@ public class FinalizingPSBTWallet extends Wallet {
|
||||||
public FinalizingPSBTWallet(PSBT psbt) {
|
public FinalizingPSBTWallet(PSBT psbt) {
|
||||||
super("Finalizing PSBT Wallet");
|
super("Finalizing PSBT Wallet");
|
||||||
|
|
||||||
if(!psbt.isSigned() || psbt.isFinalized()) {
|
if(!psbt.isSigned()) {
|
||||||
throw new IllegalArgumentException("Only a fully signed, unfinalized PSBT can be used");
|
throw new IllegalArgumentException("Only a fully signed or finalized PSBT can be used");
|
||||||
}
|
}
|
||||||
|
|
||||||
WalletNode purposeNode = getNode(KeyPurpose.RECEIVE);
|
WalletNode purposeNode = getNode(KeyPurpose.RECEIVE);
|
||||||
|
|
Loading…
Reference in a new issue