diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-06-20 14:09:36 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-06-20 14:09:49 +0200 |
commit | a6ddb19bd91df2b485080590f6f63c1e7da7ed0c (patch) | |
tree | 754ceb5b340c372832265ae46f15b1ddc3c053c3 /src/wallet/rpcdump.cpp | |
parent | 65c2058cc8e45c2f77a2ee27b89bc9440106d89b (diff) | |
parent | 595b22e5c0bf1c3e8ee73aea2f28397c12046a60 (diff) |
Merge #7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r-- | src/wallet/rpcdump.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 14c2e31d95..d55cc68dc0 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -167,6 +167,11 @@ void ImportScript(const CScript& script, const string& strLabel, bool isRedeemSc if (!pwalletMain->HaveCScript(script) && !pwalletMain->AddCScript(script)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding p2sh redeemScript to wallet"); ImportAddress(CBitcoinAddress(CScriptID(script)), strLabel); + } else { + CTxDestination destination; + if (ExtractDestination(script, destination)) { + pwalletMain->SetAddressBook(destination, strLabel, "receive"); + } } } @@ -195,6 +200,8 @@ UniValue importaddress(const UniValue& params, bool fHelp) "4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well\n" "\nNote: This call can take minutes to complete if rescan is true.\n" "If you have the full public key, you should call importpubkey instead of this.\n" + "\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\n" + "as change, and not show up in many RPCs.\n" "\nExamples:\n" "\nImport a script with rescan\n" + HelpExampleCli("importaddress", "\"myscript\"") + |