mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-25 09:36:44 +00:00
verify segwit psbt partial signatures with only non-witness utxo provided
This commit is contained in:
parent
0a43f9f6a8
commit
db05e09fe5
1 changed files with 2 additions and 6 deletions
|
@ -555,12 +555,8 @@ public class PSBTInput {
|
|||
Sha256Hash hash;
|
||||
|
||||
ScriptType scriptType = getScriptType();
|
||||
if(getWitnessUtxo() == null && Arrays.asList(WITNESS_TYPES).contains(scriptType)) {
|
||||
throw new IllegalStateException("Trying to get signature hash for " + scriptType + " script without a PSBT witness UTXO");
|
||||
}
|
||||
|
||||
if(getWitnessUtxo() != null) {
|
||||
long prevValue = getWitnessUtxo().getValue();
|
||||
if(Arrays.asList(WITNESS_TYPES).contains(scriptType)) {
|
||||
long prevValue = getUtxo().getValue();
|
||||
hash = transaction.hashForWitnessSignature(index, connectedScript, prevValue, localSigHash);
|
||||
} else {
|
||||
hash = transaction.hashForLegacySignature(index, connectedScript, localSigHash);
|
||||
|
|
Loading…
Reference in a new issue