Calculate witness sig with AES key

This commit is contained in:
Oscar Guindzberg 2020-11-18 18:28:06 -03:00
parent c1287ac43a
commit 5906950e1f
No known key found for this signature in database
GPG Key ID: 209796BF2E1D4F75
2 changed files with 2 additions and 2 deletions

View File

@ -1271,7 +1271,7 @@ public class TradeWalletService {
// scriptCode is expected to have the format of a legacy P2PKH output script
Script scriptCode = ScriptBuilder.createP2PKHOutputScript(sigKey);
Coin value = input.getValue();
TransactionSignature txSig = transaction.calculateWitnessSignature(inputIndex, sigKey, scriptCode, value,
TransactionSignature txSig = transaction.calculateWitnessSignature(inputIndex, sigKey, aesKey, scriptCode, value,
Transaction.SigHash.ALL, false);
input.setScriptSig(ScriptBuilder.createEmpty());
input.setWitness(TransactionWitness.redeemP2WPKH(txSig, sigKey));

View File

@ -327,7 +327,7 @@ public abstract class WalletService {
// scriptCode is expected to have the format of a legacy P2PKH output script
Script scriptCode = ScriptBuilder.createP2PKHOutputScript(key);
Coin value = txIn.getValue();
TransactionSignature txSig = tx.calculateWitnessSignature(index, key, scriptCode, value,
TransactionSignature txSig = tx.calculateWitnessSignature(index, key, aesKey, scriptCode, value,
Transaction.SigHash.ALL, false);
txIn.setScriptSig(ScriptBuilder.createEmpty());
txIn.setWitness(TransactionWitness.redeemP2WPKH(txSig, key));