Iam using the bitcoinjs-lib library and trying to do a transaction. Iam doing the tx.addInput method before building but running into a build issue. I assume an error is thrown if blockchainScripthash_listunspent cannot retrieve the previous tx_hash.
If not a coinbase transaction, you have to spend from an existing output. Thus the input must reference an existing transaction.
cannot retrieve the previous tx_hash
Maybe the library you are using is the following common semantic:
txidfor the transaction id (hash without the witness data)
tx_hashfor the transaction hash (hash with the witness data)
You want the
txid to reference a previous transaction in an input.