Catch 'already exists' error in importAddress

This commit is contained in:
Daniel McNally 2017-10-20 21:49:31 -04:00 committed by GitHub
parent d77838d3a2
commit b9b4e5f182

View File

@ -756,7 +756,12 @@ RPC.prototype.importAddress = async function importAddress(args, help) {
addr = parseAddress(addr, this.network);
}
await wallet.importAddress(0, addr);
try {
await wallet.importAddress(0, addr);
} catch (err) {
if (err.message !== 'Address already exists.')
throw err;
}
if (rescan)
await this.wdb.rescan(0);