FIX: multisig throwing an error on creating transaction while connected to electrs

This commit is contained in:
Overtorment 2020-11-30 15:26:37 +00:00
parent 0f99b867f3
commit ba89b76284
2 changed files with 5 additions and 1 deletions

View file

@ -307,6 +307,8 @@ module.exports.multiGetUtxoByAddress = async function (addresses, batchsize) {
if (disableBatching) {
// ElectrumPersonalServer doesnt support `blockchain.scripthash.listunspent`
// electrs OTOH supports it, but we dont know it we are currently connected to it or to EPS
// so it is pretty safe to do nothing, as caller can derive UTXO from stored transactions
} else {
results = await mainClient.blockchainScripthash_listunspentBatch(scripthashes);
}

View file

@ -679,6 +679,8 @@ export class MultisigHDWallet extends AbstractHDElectrumWallet {
});
const witnessScript = p2wsh.redeem.output;
if (!input.txhex) throw new Error('Electrum server didnt provide txhex to properly create PSBT transaction');
psbt.addInput({
hash: input.txId,
index: input.vout,
@ -932,7 +934,7 @@ export class MultisigHDWallet extends AbstractHDElectrumWallet {
newUtxos.push(u);
}
return newUtxos;
this._utxo = newUtxos;
}
getID() {