MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetNewDestination

Method GetNewDestination

src/wallet/wallet.cpp:2499–2520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2497/// end ELEMENTS
2498
2499bool CWallet::GetNewDestination(const OutputType type, const std::string label, CTxDestination& dest, bilingual_str& error, bool add_blinding_key)
2500{
2501 LOCK(cs_wallet);
2502 error.clear();
2503 bool result = false;
2504 auto spk_man = GetScriptPubKeyMan(type, false /* internal */);
2505 if (spk_man) {
2506 spk_man->TopUp();
2507 result = spk_man->GetNewDestination(type, dest, error);
2508 if (add_blinding_key) {
2509 CPubKey blinding_pubkey = GetBlindingPubKey(GetScriptForDestination(dest));
2510 std::visit(SetBlindingPubKeyVisitor(blinding_pubkey), dest);
2511 }
2512 } else {
2513 error = strprintf(_("Error: No %s addresses available."), FormatOutputType(type));
2514 }
2515 if (result) {
2516 SetAddressBook(dest, label, "receive");
2517 }
2518
2519 return result;
2520}
2521
2522bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& dest, bilingual_str& error, bool add_blinding_key)
2523{

Callers 10

getNewDestinationMethod · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
add_coinFunction · 0.45
GetScriptPubKeyMethod · 0.45
getnewaddressFunction · 0.45
getpeginaddressFunction · 0.45
createrawpeginFunction · 0.45
issueassetFunction · 0.45
reissueassetFunction · 0.45
getnewaddressFunction · 0.45

Calls 5

GetScriptForDestinationFunction · 0.85
_Function · 0.85
clearMethod · 0.45
TopUpMethod · 0.45

Tested by 4

BOOST_FIXTURE_TEST_CASEFunction · 0.36
add_coinFunction · 0.36
GetScriptPubKeyMethod · 0.36
getnewaddressFunction · 0.36