From dd757adfeefbc3bd8deb5d8c8818c4b3663b8513 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 12 Jun 2019 10:24:01 -0400 Subject: [PATCH] FundTransaction: mark all change keys as kept --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 58c40a9dba5..b16ba2970a2 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2711,6 +2711,11 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC } } + // Mark all un-returned change keys as used to reduce privacy loss + for (auto& changekey : vChangeKey) { + changekey->KeepKey(); + } + return true; }