mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 14:40:40 +01:00
Wallet: in signTransaction()
don't care about the witness being empty
It does not matter for the data being signed. This removes `Script.createEmptyWitness()` as it's unnecessary as well.
This commit is contained in:
parent
ce07733bbf
commit
d4f8058164
2 changed files with 0 additions and 14 deletions
|
@ -566,19 +566,6 @@ public class Script {
|
|||
}
|
||||
}
|
||||
|
||||
public TransactionWitness createEmptyWitness(ECKey key) {
|
||||
if (ScriptPattern.isP2WPKH(this)) {
|
||||
checkArgument(key != null, () ->
|
||||
"key required to create P2WPKH witness");
|
||||
return TransactionWitness.EMPTY;
|
||||
} else if (ScriptPattern.isP2PK(this) || ScriptPattern.isP2PKH(this)
|
||||
|| ScriptPattern.isP2SH(this)) {
|
||||
return null; // no witness
|
||||
} else {
|
||||
throw new ScriptException(ScriptError.SCRIPT_ERR_UNKNOWN_ERROR, "Do not understand script type: " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of the given scriptSig with the signature inserted in the given position.
|
||||
*/
|
||||
|
|
|
@ -4579,7 +4579,6 @@ public class Wallet extends BaseTaggableObject
|
|||
Objects.requireNonNull(redeemData, () ->
|
||||
"Transaction exists in wallet that we cannot redeem: " + txIn.getOutpoint().hash());
|
||||
txIn.setScriptSig(scriptPubKey.createEmptyInputScript(redeemData.keys.get(0), redeemData.redeemScript));
|
||||
txIn.setWitness(scriptPubKey.createEmptyWitness(redeemData.keys.get(0)));
|
||||
}
|
||||
|
||||
TransactionSigner.ProposedTransaction proposal = new TransactionSigner.ProposedTransaction(tx);
|
||||
|
|
Loading…
Add table
Reference in a new issue