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

Method SetAddressReceiveRequest

src/wallet/wallet.cpp:2880–2892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2878}
2879
2880bool CWallet::SetAddressReceiveRequest(WalletBatch& batch, const CTxDestination& dest, const std::string& id, const std::string& value)
2881{
2882 const std::string key{"rr" + id}; // "rr" prefix = "receive request" in destdata
2883 CAddressBookData& data = m_address_book.at(dest);
2884 if (value.empty()) {
2885 if (!batch.EraseDestData(EncodeDestination(dest), key)) return false;
2886 data.destdata.erase(key);
2887 } else {
2888 if (!batch.WriteDestData(EncodeDestination(dest), key, value)) return false;
2889 data.destdata[key] = value;
2890 }
2891 return true;
2892}
2893
2894std::unique_ptr<WalletDatabase> MakeWalletDatabase(const std::string& name, const DatabaseOptions& options, DatabaseStatus& status, bilingual_str& error_string)
2895{

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 5

EncodeDestinationFunction · 0.85
EraseDestDataMethod · 0.80
WriteDestDataMethod · 0.80
emptyMethod · 0.45
eraseMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64