aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/bdb.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-20 08:55:07 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-20 08:42:35 -0400
commitfa8a341b88cabfd7f8d702db7cb9972b0804bf2a (patch)
treed3799d88cba30531c5503b089025ac68126567d8 /src/wallet/bdb.cpp
parentfa021e9a5b7e930a3db0febb416942dea3a90a8f (diff)
wallet: Replace CDataStream& with CDataStream&& where appropriate
The keys and values are only to be used once because their memory is set to zero. Make that explicit by moving the bytes into the lower level methods.
Diffstat (limited to 'src/wallet/bdb.cpp')
-rw-r--r--src/wallet/bdb.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp
index a3a56aa51c..267b147f38 100644
--- a/src/wallet/bdb.cpp
+++ b/src/wallet/bdb.cpp
@@ -804,7 +804,7 @@ std::string BerkeleyDatabaseVersion()
return DbEnv::version(nullptr, nullptr, nullptr);
}
-bool BerkeleyBatch::ReadKey(CDataStream& key, CDataStream& value)
+bool BerkeleyBatch::ReadKey(CDataStream&& key, CDataStream& value)
{
if (!pdb)
return false;
@@ -820,7 +820,7 @@ bool BerkeleyBatch::ReadKey(CDataStream& key, CDataStream& value)
return false;
}
-bool BerkeleyBatch::WriteKey(CDataStream& key, CDataStream& value, bool overwrite)
+bool BerkeleyBatch::WriteKey(CDataStream&& key, CDataStream&& value, bool overwrite)
{
if (!pdb)
return true;
@@ -835,7 +835,7 @@ bool BerkeleyBatch::WriteKey(CDataStream& key, CDataStream& value, bool overwrit
return (ret == 0);
}
-bool BerkeleyBatch::EraseKey(CDataStream& key)
+bool BerkeleyBatch::EraseKey(CDataStream&& key)
{
if (!pdb)
return false;
@@ -848,7 +848,7 @@ bool BerkeleyBatch::EraseKey(CDataStream& key)
return (ret == 0 || ret == DB_NOTFOUND);
}
-bool BerkeleyBatch::HasKey(CDataStream& key)
+bool BerkeleyBatch::HasKey(CDataStream&& key)
{
if (!pdb)
return false;