mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #7687: Stop treating importaddress'ed scripts as change
595b22e
Stop treating importaddress'ed scripts as change (Pieter Wuille)
This commit is contained in:
commit
a6ddb19bd9
@ -167,6 +167,11 @@ void ImportScript(const CScript& script, const string& strLabel, bool isRedeemSc
|
|||||||
if (!pwalletMain->HaveCScript(script) && !pwalletMain->AddCScript(script))
|
if (!pwalletMain->HaveCScript(script) && !pwalletMain->AddCScript(script))
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding p2sh redeemScript to wallet");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding p2sh redeemScript to wallet");
|
||||||
ImportAddress(CBitcoinAddress(CScriptID(script)), strLabel);
|
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"
|
"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"
|
"\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"
|
"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"
|
"\nExamples:\n"
|
||||||
"\nImport a script with rescan\n"
|
"\nImport a script with rescan\n"
|
||||||
+ HelpExampleCli("importaddress", "\"myscript\"") +
|
+ HelpExampleCli("importaddress", "\"myscript\"") +
|
||||||
|
Loading…
Reference in New Issue
Block a user