From 7b15a17d556e65e0ea0ef97ff55fac8604d603da Mon Sep 17 00:00:00 2001 From: Danny Diekroeger Date: Wed, 26 Apr 2023 13:40:34 -0700 Subject: [PATCH] hard-code sighash type --- src/utils/psbt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/psbt.js b/src/utils/psbt.js index c2737706..488f9cf4 100644 --- a/src/utils/psbt.js +++ b/src/utils/psbt.js @@ -112,7 +112,7 @@ function createPsbtForBoost({ utxo, inputAddressInfo, destinationBtcAddress }) { const network = TESTNET ? bitcoin.networks.testnet : bitcoin.networks.bitcoin; const psbt = new bitcoin.Psbt({ network }); - const sighashType = 131 // bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY; + const sighashType = 131; // bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY; const inputParams = getInputParams({ utxo, inputAddressInfo, sighashType }); const output = 10000; // TODO: make this a constant. psbt.addOutput({ @@ -145,7 +145,7 @@ export async function signAndBroadcastUtxo({ pubKey, utxo, destinationBtcAddress export async function createAndSignPsbtForBoost({ pubKey, utxo, destinationBtcAddress }) { const inputAddressInfo = getAddressInfo(pubKey); const { psbt, inputParams } = createPsbtForBoost({ utxo, inputAddressInfo, destinationBtcAddress }); - const sighashType = 131 // bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY; + const sighashType = 131; // bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY; const signed = await getSignedPsbt({ psbt, inputParams, inputAddressInfo, utxo, sighashType }); // Finalize the PSBT. Note that the transaction will not be broadcast to the Bitcoin network yet. signed.finalizeAllInputs();