HomePhabricator

[Cashtab] fetchTxDataForNullUtxos array threshold fix

Description

[Cashtab] fetchTxDataForNullUtxos array threshold fix

Summary:

  • The fetchTxDataForNullUtxos() function in useBCH.js builds an array of tx IDs and then passes them to BCH.Electrumx.txData() to retrieve the corresponding transaction data.
  • The problem is BCH.Electrumx.txData() is limited to 20 TXIDs per request according to the spec, and wallets with > 20 null utxos will cause this api call to throw an 'array too large' error and fetchTxDataForNullUtxos()'s catch logic ignores the entire utxo set.
  • This diff batches up the array into 20 elements each before making the API call.

Test Plan:

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D10668

Details

Provenance
emackAuthored on Dec 14 2021, 13:26
emackPushed on Dec 17 2021, 23:37
Reviewer
Restricted Project
Differential Revision
D10668: [Cashtab] fetchTxDataForNullUtxos array threshold fix
Parents
rABC7824386cdb6b: Bump version to 0.24.9
Branches
Unknown
Tags
Unknown