Skip to content

Commit afa3714

Browse files
committed
Merge pull request #60
7b1310c Add support for importaddress (Adithya Venkatesh)
2 parents a93de41 + 7b1310c commit afa3714

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

bitcoin/rpc.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,19 @@ def gettxout(self, outpoint, includemempool=True):
385385
r['bestblock'] = lx(r['bestblock'])
386386
return r
387387

388+
def importaddress(self, addr, label=None, rescan=True):
389+
"""Adds an address or pubkey to wallet without the associated privkey."""
390+
addr = str(addr)
391+
392+
if label is not None:
393+
if rescan:
394+
r = self._call('importaddress', addr, label, True)
395+
else:
396+
r = self._call('importaddress', addr, label)
397+
else:
398+
r = self._call('importaddress', addr)
399+
return r
400+
388401
def listunspent(self, minconf=0, maxconf=9999999, addrs=None):
389402
"""Return unspent transaction outputs in wallet
390403

0 commit comments

Comments
 (0)