mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 18:16:45 +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;
|
Sha256Hash hash;
|
||||||
|
|
||||||
ScriptType scriptType = getScriptType();
|
ScriptType scriptType = getScriptType();
|
||||||
if(getWitnessUtxo() == null && Arrays.asList(WITNESS_TYPES).contains(scriptType)) {
|
if(Arrays.asList(WITNESS_TYPES).contains(scriptType)) {
|
||||||
throw new IllegalStateException("Trying to get signature hash for " + scriptType + " script without a PSBT witness UTXO");
|
long prevValue = getUtxo().getValue();
|
||||||
}
|
|
||||||
|
|
||||||
if(getWitnessUtxo() != null) {
|
|
||||||
long prevValue = getWitnessUtxo().getValue();
|
|
||||||
hash = transaction.hashForWitnessSignature(index, connectedScript, prevValue, localSigHash);
|
hash = transaction.hashForWitnessSignature(index, connectedScript, prevValue, localSigHash);
|
||||||
} else {
|
} else {
|
||||||
hash = transaction.hashForLegacySignature(index, connectedScript, localSigHash);
|
hash = transaction.hashForLegacySignature(index, connectedScript, localSigHash);
|
||||||
|
|
Loading…
Reference in a new issue