diff --git a/src/helpers/wallet.js b/src/helpers/wallet.js index 639d98d..78de19f 100644 --- a/src/helpers/wallet.js +++ b/src/helpers/wallet.js @@ -1838,21 +1838,23 @@ export async function getAddrsTransactions({ } for await (let vout of tx.vout) { - for await (let addr of vout.scriptPubKey.addresses) { - // let addr = vout.scriptPubKey.addresses[0] - conAddr = contactAddrs[addr] - - if(storeAddrs[addr]) { - receivedAmount += Number(vout.value) - } else { - // sentAmount -= Number(vout.value) - } - - if (conAddr) { - processInOut({ - tx, addr, conAddr, dir, receivedAmount, - byAlias, byAddress, byTx, - }) + if (vout?.scriptPubKey?.addresses) { + for await (let addr of vout.scriptPubKey.addresses) { + // let addr = vout.scriptPubKey.addresses[0] + conAddr = contactAddrs[addr] + + if(storeAddrs[addr]) { + receivedAmount += Number(vout.value) + } else { + // sentAmount -= Number(vout.value) + } + + if (conAddr) { + processInOut({ + tx, addr, conAddr, dir, receivedAmount, + byAlias, byAddress, byTx, + }) + } } } }