Catch 'not found' error in getAddressesByAccount
This commit is contained in:
parent
6bc8701f23
commit
d77838d3a2
@ -372,11 +372,17 @@ RPC.prototype.getAddressesByAccount = async function getAddressesByAccount(args,
|
|||||||
if (name === '')
|
if (name === '')
|
||||||
name = 'default';
|
name = 'default';
|
||||||
|
|
||||||
const paths = await wallet.getPaths(name);
|
try {
|
||||||
|
const paths = await wallet.getPaths(name);
|
||||||
|
|
||||||
for (const path of paths) {
|
for (const path of paths) {
|
||||||
const addr = path.toAddress();
|
const addr = path.toAddress();
|
||||||
addrs.push(addr.toString(this.network));
|
addrs.push(addr.toString(this.network));
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
if(err.message !== 'Account not found.') {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return addrs;
|
return addrs;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user