Skip to content

Commit 143e295

Browse files
author
Ross Nicoll
committed
Add dumpprivkey call support.
1 parent df1adeb commit 143e295

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bitcoin/rpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import bitcoin
3434
from bitcoin.core import COIN, lx, b2lx, CBlock, CTransaction, COutPoint, CTxOut
3535
from bitcoin.core.script import CScript
36-
from bitcoin.wallet import CBitcoinAddress
36+
from bitcoin.wallet import CBitcoinAddress, CBitcoinSecret
3737

3838
DEFAULT_USER_AGENT = "AuthServiceProxy/0.1"
3939

@@ -211,6 +211,14 @@ def __init__(self, service_url=None,
211211
super(Proxy, self).__init__(service_url=service_url, service_port=service_port, btc_conf_file=btc_conf_file,
212212
timeout=timeout,
213213
**kwargs)
214+
215+
def dumpprivkey(self, addr):
216+
"""Return the private key matching an address
217+
"""
218+
r = self._call('dumpprivkey', str(addr))
219+
220+
return CBitcoinSecret(r)
221+
214222
def getaccountaddress(self, account=None):
215223
"""Return the current Bitcoin address for receiving payments to this account."""
216224
r = self._call('getaccountaddress', account)

0 commit comments

Comments
 (0)