mirror of
https://github.com/Retropex/mempool.git
synced 2025-05-13 02:30:41 +02:00
Handle error from bitcoin client when querying prevouts
This commit is contained in:
parent
5b331c144b
commit
af0c78be81
@ -960,16 +960,20 @@ class BitcoinRoutes {
|
|||||||
unconfirmed = true;
|
unconfirmed = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const rawPrevout = await bitcoinClient.getTxOut(outpoint.txid, outpoint.vout, false);
|
try {
|
||||||
if (rawPrevout) {
|
const rawPrevout = await bitcoinClient.getTxOut(outpoint.txid, outpoint.vout, false);
|
||||||
prevout = {
|
if (rawPrevout) {
|
||||||
value: Math.round(rawPrevout.value * 100000000),
|
prevout = {
|
||||||
scriptpubkey: rawPrevout.scriptPubKey.hex,
|
value: Math.round(rawPrevout.value * 100000000),
|
||||||
scriptpubkey_asm: rawPrevout.scriptPubKey.asm ? transactionUtils.convertScriptSigAsm(rawPrevout.scriptPubKey.hex) : '',
|
scriptpubkey: rawPrevout.scriptPubKey.hex,
|
||||||
scriptpubkey_type: transactionUtils.translateScriptPubKeyType(rawPrevout.scriptPubKey.type),
|
scriptpubkey_asm: rawPrevout.scriptPubKey.asm ? transactionUtils.convertScriptSigAsm(rawPrevout.scriptPubKey.hex) : '',
|
||||||
scriptpubkey_address: rawPrevout.scriptPubKey && rawPrevout.scriptPubKey.address ? rawPrevout.scriptPubKey.address : '',
|
scriptpubkey_type: transactionUtils.translateScriptPubKeyType(rawPrevout.scriptPubKey.type),
|
||||||
};
|
scriptpubkey_address: rawPrevout.scriptPubKey && rawPrevout.scriptPubKey.address ? rawPrevout.scriptPubKey.address : '',
|
||||||
unconfirmed = false;
|
};
|
||||||
|
unconfirmed = false;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Ignore bitcoin client errors, just leave prevout as null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user