aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/interfaces.cpp
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2021-09-23 14:54:02 +1200
committerSamuel Dobson <dobsonsa68@gmail.com>2021-09-25 23:50:06 +1200
commitd96b000e94d72d041689c5c47e374df2ebc0e011 (patch)
tree893d38948a7073c2902bf4520bcb49ae9013b2cf /src/wallet/interfaces.cpp
parent077154fe698f5556ad6e26ef49c9024c2f07ff68 (diff)
downloadbitcoin-d96b000e94d72d041689c5c47e374df2ebc0e011.tar.xz
Make GUI UTXO lock/unlock persistent
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r--src/wallet/interfaces.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 809569cfaa..d9fc6de79b 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -214,15 +214,17 @@ public:
LOCK(m_wallet->cs_wallet);
return m_wallet->DisplayAddress(dest);
}
- bool lockCoin(const COutPoint& output) override
+ bool lockCoin(const COutPoint& output, const bool write_to_db) override
{
LOCK(m_wallet->cs_wallet);
- return m_wallet->LockCoin(output);
+ std::unique_ptr<WalletBatch> batch = write_to_db ? std::make_unique<WalletBatch>(m_wallet->GetDatabase()) : nullptr;
+ return m_wallet->LockCoin(output, batch.get());
}
bool unlockCoin(const COutPoint& output) override
{
LOCK(m_wallet->cs_wallet);
- return m_wallet->UnlockCoin(output);
+ std::unique_ptr<WalletBatch> batch = std::make_unique<WalletBatch>(m_wallet->GetDatabase());
+ return m_wallet->UnlockCoin(output, batch.get());
}
bool isLockedCoin(const COutPoint& output) override
{