diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2011-07-13 11:56:38 +0200 |
---|---|---|
committer | Pieter Wuille <sipa@ulyssis.org> | 2011-12-17 21:49:48 +0100 |
commit | 95d888a6d1f659a5cb81124e0d97966b9de1f139 (patch) | |
tree | db17f76d0517ddbf12fd9144948816e930439eef /src/wallet.cpp | |
parent | 30ab2c9c46ce38197017ce6a6e13869617e692c7 (diff) |
Key import and export
Introduces two new RPC calls:
* dumpprivkey: retrieve the private key corresponding to an address
* importprivkey: add a private key to your wallet
The private key format is analoguous to the address format. It is
a 51-character base58-encoded string, that includes a version number
and a checksum.
Includes patch by mhanne:
* add optional account parameter for importprivkey, if omitted use default
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index f9157e01d5..87f5dfd659 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -224,6 +224,15 @@ void CWallet::WalletUpdateSpent(const CTransaction &tx) } } +void CWallet::MarkDirty() +{ + CRITICAL_BLOCK(cs_wallet) + { + BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet) + item.second.MarkDirty(); + } +} + bool CWallet::AddToWallet(const CWalletTx& wtxIn) { uint256 hash = wtxIn.GetHash(); @@ -1445,6 +1454,7 @@ void CWallet::GetAllReserveAddresses(set<CBitcoinAddress>& setAddress) CWalletDB walletdb(strWalletFile); CRITICAL_BLOCK(cs_main) + CRITICAL_BLOCK(cs_wallet) BOOST_FOREACH(const int64& id, setKeyPool) { CKeyPool keypool; |