| 215 | return m_wallet->GetAddressReceiveRequests(); |
| 216 | } |
| 217 | bool setAddressReceiveRequest(const CTxDestination& dest, const std::string& id, const std::string& value) override { |
| 218 | // Note: The setAddressReceiveRequest interface used by the GUI to store |
| 219 | // receive requests is a little awkward and could be improved in the |
| 220 | // future: |
| 221 | // |
| 222 | // - The same method is used to save requests and erase them, but |
| 223 | // having separate methods could be clearer and prevent bugs. |
| 224 | // |
| 225 | // - Request ids are passed as strings even though they are generated as |
| 226 | // integers. |
| 227 | // |
| 228 | // - Multiple requests can be stored for the same address, but it might |
| 229 | // be better to only allow one request or only keep the current one. |
| 230 | LOCK(m_wallet->cs_wallet); |
| 231 | WalletBatch batch{m_wallet->GetDatabase()}; |
| 232 | return value.empty() ? m_wallet->EraseAddressReceiveRequest(batch, dest, id) |
| 233 | : m_wallet->SetAddressReceiveRequest(batch, dest, id, value); |
| 234 | } |
| 235 | util::Result<void> displayAddress(const CTxDestination& dest) override |
| 236 | { |
| 237 | LOCK(m_wallet->cs_wallet); |
no test coverage detected