LedgerHQ / ledger-live-desktop

⛔️ DEPRECATED - Ledger Live (Desktop)
https://www.ledger.com/live
MIT License
953 stars 301 forks source link

BCH wallet doesn't sync if it ever received OP_RETURN txs #4840

Open elderapo opened 2 years ago

elderapo commented 2 years ago

Ledger Live Version and Operating System

Expected behavior

Basically, your API returns <unknown> address value when output is OP_RETURN (it has no address, can be seen/tested here). Then somewhere else in a code there is a call to toCashAddress which throws for OP_RETURN outputs because it can't convert <unknown> string into a valid bitcoin cash address.

InvalidAddressError: Received an invalid Bitcoin Cash address as input.
   at new InvalidAddressError (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/bchaddrjs/src/bchaddr.js:434:15)
   at decodeAddress (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/bchaddrjs/src/bchaddr.js:176:9)
   at Object.toCashAddress (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/bchaddrjs/src/bchaddr.js:136:17)
   at bchToCashaddrAddressWithoutPrefix (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/logic.js:143:47)
   at syncReplaceAddress (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/logic.js:181:54)
   at mapTxToOperations (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:192:31)
   at /tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:393:28
   at Array.map (<anonymous>)
   at /tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:392:106
   at step (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:44:23)
   at Object.next (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:25:53)
   at fulfilled (/tmp/.mount_ledgeraKTW1w/resources/app.asar/node_modules/@ledgerhq/live-common/lib/families/bitcoin/js-synchronisation.js:16:58)
   at runMicrotasks (<anonymous>)
   at processTicksAndRejections (internal/process/task_queues.js:93:5)
elderapo commented 2 years ago

I am pretty sure it worked fine in the past so probably https://explorers.api.live.ledger.com/blockchain/v3/bch/addresses/bitcoincash:qz00gq5knkfc9m4ejepcawzgl2fxzznvquc5cnfnkf/transactions just used to not include OP_RETURN outpoints.

elderapo commented 2 years ago

Can this get addressed? I am not able to use my wallet because of that.