| 2878 | } |
| 2879 | |
| 2880 | bool 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 | |
| 2894 | std::unique_ptr<WalletDatabase> MakeWalletDatabase(const std::string& name, const DatabaseOptions& options, DatabaseStatus& status, bilingual_str& error_string) |
| 2895 | { |