HomePhabricator

[Cashtab] Ignore tx history for large-input txs

Description

[Cashtab] Ignore tx history for large-input txs

Summary:
T1824

The`BCH.RawTransactions.getTxData(txid) function from bch-js` chokes on transactions with a large amount of inputs. In this case, it returns undefined instead of an object.

This means that if your wallet has such a tx in the last 5 txs, it will always through an API rate limit error, making Cashtab impossible to use.

This diff catches such cases and omits them from the tx history.

This fix prevents the wallet crash error. However, a more permanent way to deal with this would be to improve the function in bch-js.

Test Plan:

  1. DM me for a recovery seed of a wallet with such a transaction
  2. Import the wallet.
  3. Note that it loads with < 5 txs in history but does not instantly rate limit.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Sep 13 2021, 13:06
bytesofmanPushed on Sep 13 2021, 14:04
Reviewer
Restricted Project
Differential Revision
D10093: [Cashtab] Ignore tx history for large-input txs
Parents
rABC1241ef50e90d: rpc: document returned error fields as optional if applicable
Branches
Unknown
Tags
Unknown