Catch 'already exists' error in importAddress
This commit is contained in:
parent
d77838d3a2
commit
b9b4e5f182
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user