Skip to content

Commit ed8cd36

Browse files
committed
Merge pull request #40
143e295 Add dumpprivkey call support. (Ross Nicoll)
2 parents 0fc7123 + 143e295 commit ed8cd36

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bitcoin/rpc.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (C) 2007 Jan-Klaas Kollhof
2-
# Copyright (C) 2011-2014 The python-bitcoinlib developers
2+
# Copyright (C) 2011-2015 The python-bitcoinlib developers
33
#
44
# This file is part of python-bitcoinlib.
55
#
@@ -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)