aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-04-12 13:40:43 -0400
committerRussell Yanofsky <russ@yanofsky.org>2021-03-03 10:19:35 -0400
commit62252c95e5aa55f33a5ef22292d5d8161fcb892a (patch)
treef234ce0a5a2d8bdeb32cd2a57188f34c4bf9fc50 /src/wallet/test
parent985430d9b2e183c1f59a34472e413a8d00a7e6da (diff)
interfaces: Stop exposing wallet destdata to gui
Stop giving GUI access to destdata rows in database. Replace with narrow API just for saving and reading receive request information. This simplifies code and should prevent the GUI from interfering with other destdata like address-used status. Note: No user-visible behavior is changing in this commit. New CWallet::SetAddressReceiveRequest() implementation avoids a bug in CWallet::AddDestData() where a modification would leave the previous value in memory while writing the new value to disk. But it doesn't matter because the GUI doesn't currently expose the ability to modify receive requests, only to add and erase them.
Diffstat (limited to 'src/wallet/test')
-rw-r--r--src/wallet/test/wallet_tests.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index 5480f3ab22..932a0c2eca 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -391,10 +391,10 @@ BOOST_AUTO_TEST_CASE(LoadReceiveRequests)
LOCK(m_wallet.cs_wallet);
WalletBatch batch{m_wallet.GetDatabase()};
m_wallet.AddDestData(batch, dest, "misc", "val_misc");
- m_wallet.AddDestData(batch, dest, "rr0", "val_rr0");
- m_wallet.AddDestData(batch, dest, "rr1", "val_rr1");
+ m_wallet.SetAddressReceiveRequest(batch, dest, "0", "val_rr0");
+ m_wallet.SetAddressReceiveRequest(batch, dest, "1", "val_rr1");
- auto values = m_wallet.GetDestValues("rr");
+ auto values = m_wallet.GetAddressReceiveRequests();
BOOST_CHECK_EQUAL(values.size(), 2U);
BOOST_CHECK_EQUAL(values[0], "val_rr0");
BOOST_CHECK_EQUAL(values[1], "val_rr1");