REF: better handling large transactions from electrum

This commit is contained in:
Overtorment 2021-07-26 12:46:03 +01:00
parent 706c5f7634
commit 37d99089bb

View file

@ -597,7 +597,9 @@ module.exports.multiGetTransactionByTxid = async function (txids, batchsize, ver
if (txdata.error && txdata.error.code === -32600) {
// response too large
// lets do single call, that should go through okay:
txdata.result = await mainClient.blockchainTransaction_get(txdata.param, verbose);
txdata.result = await mainClient.blockchainTransaction_get(txdata.param, false);
// since we used VERBOSE=false, server sent us plain txhex which we must decode on our end:
txdata.result = txhexToElectrumTransaction(txdata.result);
}
ret[txdata.param] = txdata.result;
if (ret[txdata.param]) delete ret[txdata.param].hex; // compact