From e50cbd7afcc5a4146da8868b3031edd7d727d592 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 c86ab1d269..6bc7a3d2d8 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2700,6 +2700,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; }