Skip to content

Commit 9093b64

Browse files
committed
Update importaddress rpc call to handle no label, rescan=False
1 parent 2a51acf commit 9093b64

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

bitcoin/rpc.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,11 @@ def gettxout(self, outpoint, includemempool=True):
388388
r['bestblock'] = lx(r['bestblock'])
389389
return r
390390

391-
def importaddress(self, addr, label=None, rescan=True):
391+
def importaddress(self, addr, label='', rescan=True):
392392
"""Adds an address or pubkey to wallet without the associated privkey."""
393393
addr = str(addr)
394394

395-
if label is not None:
396-
if rescan:
397-
r = self._call('importaddress', addr, label, True)
398-
else:
399-
r = self._call('importaddress', addr, label)
400-
else:
401-
r = self._call('importaddress', addr)
395+
r = self._call('importaddress', addr, label, rescan)
402396
return r
403397

404398
def listunspent(self, minconf=0, maxconf=9999999, addrs=None):

0 commit comments

Comments
 (0)