BCH wallet doesn't sync if it ever received OP_RETURN txs
elderapo opened this issue · 2 comments
elderapo commented
Ledger Live Version and Operating System
- tested on Ledger Live v2.39.2, master + on some older versions, and seems like it has been broken since forver.
- Platform and version: Ubuntu 20.04
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
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
Can this get addressed? I am not able to use my wallet because of that.