wallet: Reuse existing batch in CWallet::SetUsedDestinationState

This commit is contained in:
João Barbosa
2019-11-02 16:20:45 +00:00
parent 01f45dd00e
commit 0b75a7f068
4 changed files with 19 additions and 16 deletions

View File

@@ -170,12 +170,14 @@ public:
bool addDestData(const CTxDestination& dest, const std::string& key, const std::string& value) override
{
LOCK(m_wallet->cs_wallet);
return m_wallet->AddDestData(dest, key, value);
WalletBatch batch{m_wallet->GetDatabase()};
return m_wallet->AddDestData(batch, dest, key, value);
}
bool eraseDestData(const CTxDestination& dest, const std::string& key) override
{
LOCK(m_wallet->cs_wallet);
return m_wallet->EraseDestData(dest, key);
WalletBatch batch{m_wallet->GetDatabase()};
return m_wallet->EraseDestData(batch, dest, key);
}
std::vector<std::string> getDestValues(const std::string& prefix) override
{