Skip to content

Commit 08ee0c2

Browse files
authored
Merge pull request #300 from secretkeylabs/vic/fix-psbt-bug
Fix bug with parsing PSBT and knownEmptyTxids
2 parents c9e9782 + 92033be commit 08ee0c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

transactions/bitcoin/enhancedPsbt.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { concatBytes } from 'micro-packed';
55

66
import { getRunesClient } from '../../api';
77
import { UTXO } from '../../types';
8-
import { getBtcNetwork, getBtcNetworkDefinition, isInscriptionsAndRunesCompatible } from '../btcNetwork';
8+
import { getBtcNetworkDefinition, isInscriptionsAndRunesCompatible } from '../btcNetwork';
99
import { InputToSign, TransactionContext } from './context';
1010
import { ExtendedDummyUtxo, ExtendedUtxo } from './extendedUtxo';
1111
import {
@@ -184,13 +184,14 @@ export class EnhancedPsbt {
184184
inputTxid: string,
185185
knownEmptyTxids?: string[],
186186
) => {
187-
if (knownEmptyTxids && !knownEmptyTxids.includes(inputTxid)) {
187+
if (!knownEmptyTxids?.includes(inputTxid)) {
188188
const addressInput = await this._context.getUtxoFallbackToExternal(`${inputTxid}:${inputRaw.index}`);
189189
if (addressInput && addressInput.extendedUtxo) {
190190
return addressInput.extendedUtxo;
191191
}
192192
}
193193

194+
// we know this UTXO won't exist, so we create a dummy one
194195
const utxo: UTXO = {
195196
txid: inputTxid,
196197
vout: inputRaw.index!,

0 commit comments

Comments
 (0)