MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetNewDestination

Method GetNewDestination

src/wallet/wallet.cpp:2609–2623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2607}
2608
2609util::Result<CTxDestination> CWallet::GetNewDestination(const OutputType type, const std::string& label)
2610{
2611 LOCK(cs_wallet);
2612 auto spk_man = GetScriptPubKeyMan(type, /*internal=*/false);
2613 if (!spk_man) {
2614 return util::Error{strprintf(_("Error: No %s addresses available."), FormatOutputType(type))};
2615 }
2616
2617 auto op_dest = spk_man->GetNewDestination(type);
2618 if (op_dest) {
2619 SetAddressBook(*op_dest, label, AddressPurpose::RECEIVE);
2620 }
2621
2622 return op_dest;
2623}
2624
2625util::Result<CTxDestination> CWallet::GetNewChangeDestination(const OutputType type)
2626{

Callers 11

getNewDestinationMethod · 0.45
TestCoinsResultFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
add_coinFunction · 0.45
getNewDestinationFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
getnewaddressFunction · 0.45
GetDestinationMethod · 0.45
AddTxFunction · 0.45

Calls 1

_Function · 0.85

Tested by 7

TestCoinsResultFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
add_coinFunction · 0.36
getNewDestinationFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
GetDestinationMethod · 0.36