diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-22 08:05:29 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-22 08:06:11 +0100 |
commit | 6586bc3b51ac0a3891ff6297e1aea791ff331cd3 (patch) | |
tree | a3505d306c0433067aa4cc0cf29680a76ff0ebaf | |
parent | 250b4bcf6b368825ca6a49509f63026bd374efa4 (diff) | |
parent | 1f12844fc03dfc1863ea9a5096f8650c64a0b2ac (diff) |
Merge pull request #3502
1f12844 Fix importprivkey / rescan (Cozz Lovan)
-rw-r--r-- | src/rpcdump.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index c801b284cb..18c8bb6e61 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -116,9 +116,14 @@ Value importprivkey(const Array& params, bool fHelp) if (pwalletMain->HaveKey(vchAddress)) return Value::null; + pwalletMain->mapKeyMetadata[vchAddress].nCreateTime = 1; + if (!pwalletMain->AddKeyPubKey(key, pubkey)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); + // whenever a key is imported, we need to scan the whole chain + pwalletMain->nTimeFirstKey = 1; // 0 would be considered 'no value' + if (fRescan) { pwalletMain->ScanForWalletTransactions(chainActive.Genesis(), true); pwalletMain->ReacceptWalletTransactions(); |