Skip to content

Commit c7b0d80

Browse files
Merge dashpay#6441: fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload
2d7c7f8 fix: do not transfer wallet ownership to CTransactionBuilder{Output} (UdjinM6) 0aeeb85 fix: add missing `AddWallet` call in `TestLoadWallet` (UdjinM6) e800d9d fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload (UdjinM6) Pull request description: ## Issue being fixed or feature implemented dashpay#6440 (comment) ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 2d7c7f8 Tree-SHA512: 308e3bed077baa2167b7f9d81b87e5a61a113e4d465706548f303dfc499bc072d4e823e85772e591a879986b0fb0413d5afe0e3995e1f939fa772b29adc0300d
1 parent c074e09 commit c7b0d80

File tree

9 files changed

+121
-127
lines changed

9 files changed

+121
-127
lines changed

src/coinjoin/client.cpp

Lines changed: 58 additions & 74 deletions
Large diffs are not rendered by default.

src/coinjoin/client.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CoinJoinWalletManager {
9696
}
9797
}
9898

99-
void Add(CWallet& wallet);
99+
void Add(const std::shared_ptr<CWallet>& wallet);
100100
void DoMaintenance();
101101

102102
void Remove(const std::string& name);
@@ -138,7 +138,7 @@ class CoinJoinWalletManager {
138138
class CCoinJoinClientSession : public CCoinJoinBaseSession
139139
{
140140
private:
141-
CWallet& m_wallet;
141+
const std::shared_ptr<CWallet> m_wallet;
142142
CoinJoinWalletManager& m_walletman;
143143
CCoinJoinClientManager& m_clientman;
144144
CDeterministicMNManager& m_dmnman;
@@ -163,15 +163,15 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
163163
/// Create denominations
164164
bool CreateDenominated(CAmount nBalanceToDenominate);
165165
bool CreateDenominated(CAmount nBalanceToDenominate, const CompactTallyItem& tallyItem, bool fCreateMixingCollaterals)
166-
EXCLUSIVE_LOCKS_REQUIRED(m_wallet.cs_wallet);
166+
EXCLUSIVE_LOCKS_REQUIRED(m_wallet->cs_wallet);
167167

168168
/// Split up large inputs or make fee sized inputs
169169
bool MakeCollateralAmounts();
170170
bool MakeCollateralAmounts(const CompactTallyItem& tallyItem, bool fTryDenominated)
171-
EXCLUSIVE_LOCKS_REQUIRED(m_wallet.cs_wallet);
171+
EXCLUSIVE_LOCKS_REQUIRED(m_wallet->cs_wallet);
172172

173173
bool CreateCollateralTransaction(CMutableTransaction& txCollateral, std::string& strReason)
174-
EXCLUSIVE_LOCKS_REQUIRED(m_wallet.cs_wallet);
174+
EXCLUSIVE_LOCKS_REQUIRED(m_wallet->cs_wallet);
175175

176176
bool JoinExistingQueue(CAmount nBalanceNeedsAnonymized, CConnman& connman);
177177
bool StartNewQueue(CAmount nBalanceNeedsAnonymized, CConnman& connman);
@@ -181,7 +181,7 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
181181
/// step 1: prepare denominated inputs and outputs
182182
bool PrepareDenominate(int nMinRounds, int nMaxRounds, std::string& strErrorRet, const std::vector<CTxDSIn>& vecTxDSIn,
183183
std::vector<std::pair<CTxDSIn, CTxOut>>& vecPSInOutPairsRet, bool fDryRun = false)
184-
EXCLUSIVE_LOCKS_REQUIRED(m_wallet.cs_wallet);
184+
EXCLUSIVE_LOCKS_REQUIRED(m_wallet->cs_wallet);
185185
/// step 2: send denominated inputs and outputs prepared in step 1
186186
bool SendDenominate(const std::vector<std::pair<CTxDSIn, CTxOut> >& vecPSInOutPairsIn, CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
187187

@@ -200,7 +200,7 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
200200
void SetNull() override EXCLUSIVE_LOCKS_REQUIRED(cs_coinjoin);
201201

202202
public:
203-
explicit CCoinJoinClientSession(CWallet& wallet, CoinJoinWalletManager& walletman,
203+
explicit CCoinJoinClientSession(const std::shared_ptr<CWallet>& wallet, CoinJoinWalletManager& walletman,
204204
CCoinJoinClientManager& clientman, CDeterministicMNManager& dmnman,
205205
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
206206
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode);
@@ -267,7 +267,7 @@ class CCoinJoinClientQueueManager : public CCoinJoinBaseManager
267267
class CCoinJoinClientManager
268268
{
269269
private:
270-
CWallet& m_wallet;
270+
const std::shared_ptr<CWallet> m_wallet;
271271
CoinJoinWalletManager& m_walletman;
272272
CDeterministicMNManager& m_dmnman;
273273
CMasternodeMetaMan& m_mn_metaman;
@@ -306,11 +306,19 @@ class CCoinJoinClientManager
306306
CCoinJoinClientManager(CCoinJoinClientManager const&) = delete;
307307
CCoinJoinClientManager& operator=(CCoinJoinClientManager const&) = delete;
308308

309-
explicit CCoinJoinClientManager(CWallet& wallet, CoinJoinWalletManager& walletman, CDeterministicMNManager& dmnman,
310-
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
309+
explicit CCoinJoinClientManager(const std::shared_ptr<CWallet>& wallet, CoinJoinWalletManager& walletman,
310+
CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
311+
const CMasternodeSync& mn_sync,
311312
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode) :
312-
m_wallet(wallet), m_walletman(walletman), m_dmnman(dmnman), m_mn_metaman(mn_metaman), m_mn_sync(mn_sync), m_queueman(queueman),
313-
m_is_masternode{is_masternode} {}
313+
m_wallet(wallet),
314+
m_walletman(walletman),
315+
m_dmnman(dmnman),
316+
m_mn_metaman(mn_metaman),
317+
m_mn_sync(mn_sync),
318+
m_queueman(queueman),
319+
m_is_masternode{is_masternode}
320+
{
321+
}
314322

315323
void ProcessMessage(CNode& peer, CChainState& active_chainstate, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
316324

src/coinjoin/interfaces.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ class CoinJoinLoaderImpl : public interfaces::CoinJoin::Loader
6767
explicit CoinJoinLoaderImpl(CoinJoinWalletManager& walletman)
6868
: m_walletman(walletman) {}
6969

70-
void AddWallet(CWallet& wallet) override
71-
{
72-
m_walletman.Add(wallet);
73-
}
70+
void AddWallet(const std::shared_ptr<CWallet>& wallet) override { m_walletman.Add(wallet); }
7471
void RemoveWallet(const std::string& name) override
7572
{
7673
m_walletman.Remove(name);

src/coinjoin/util.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ void CKeyHolderStorage::ReturnAll()
8787
}
8888
}
8989

90-
CTransactionBuilderOutput::CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, std::shared_ptr<CWallet> pwalletIn, CAmount nAmountIn) :
90+
CTransactionBuilderOutput::CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn,
91+
const std::shared_ptr<CWallet>& wallet, CAmount nAmountIn) :
9192
pTxBuilder(pTxBuilderIn),
92-
dest(pwalletIn.get()),
93+
dest(wallet.get()),
9394
nAmount(nAmountIn)
9495
{
9596
assert(pTxBuilder);
9697
CTxDestination txdest;
97-
LOCK(pwalletIn->cs_wallet);
98+
LOCK(wallet->cs_wallet);
9899
dest.GetReservedDestination(txdest, false);
99100
script = ::GetScriptForDestination(txdest);
100101
}
@@ -108,15 +109,15 @@ bool CTransactionBuilderOutput::UpdateAmount(const CAmount nNewAmount)
108109
return true;
109110
}
110111

111-
CTransactionBuilder::CTransactionBuilder(std::shared_ptr<CWallet> pwalletIn, const CompactTallyItem& tallyItemIn) :
112-
pwallet(pwalletIn),
113-
dummyReserveDestination(pwalletIn.get()),
112+
CTransactionBuilder::CTransactionBuilder(const std::shared_ptr<CWallet>& wallet, const CompactTallyItem& tallyItemIn) :
113+
m_wallet(wallet),
114+
dummyReserveDestination(wallet.get()),
114115
tallyItem(tallyItemIn)
115116
{
116117
// Generate a feerate which will be used to consider if the remainder is dust and will go into fees or not
117-
coinControl.m_discard_feerate = ::GetDiscardRate(*pwallet);
118+
coinControl.m_discard_feerate = ::GetDiscardRate(*m_wallet);
118119
// Generate a feerate which will be used by calculations of this class and also by CWallet::CreateTransaction
119-
coinControl.m_feerate = std::max(GetRequiredFeeRate(*pwallet), pwallet->m_pay_tx_fee);
120+
coinControl.m_feerate = std::max(GetRequiredFeeRate(*m_wallet), m_wallet->m_pay_tx_fee);
120121
// Change always goes back to origin
121122
coinControl.destChange = tallyItemIn.txdest;
122123
// Only allow tallyItems inputs for tx creation
@@ -131,16 +132,16 @@ CTransactionBuilder::CTransactionBuilder(std::shared_ptr<CWallet> pwalletIn, con
131132
// Get a comparable dummy scriptPubKey, avoid writing/flushing to the actual wallet db
132133
CScript dummyScript;
133134
{
134-
LOCK(pwallet->cs_wallet);
135-
WalletBatch dummyBatch(pwallet->GetDatabase(), false);
135+
LOCK(m_wallet->cs_wallet);
136+
WalletBatch dummyBatch(m_wallet->GetDatabase(), false);
136137
dummyBatch.TxnBegin();
137138
CKey secret;
138-
secret.MakeNewKey(pwallet->CanSupportFeature(FEATURE_COMPRPUBKEY));
139+
secret.MakeNewKey(m_wallet->CanSupportFeature(FEATURE_COMPRPUBKEY));
139140
CPubKey dummyPubkey = secret.GetPubKey();
140141
dummyBatch.TxnAbort();
141142
dummyScript = ::GetScriptForDestination(PKHash(dummyPubkey));
142143
// Calculate required bytes for the dummy signed tx with tallyItem's inputs only
143-
nBytesBase = CalculateMaximumSignedTxSize(CTransaction(dummyTx), pwallet.get(), false);
144+
nBytesBase = CalculateMaximumSignedTxSize(CTransaction(dummyTx), m_wallet.get(), false);
144145
}
145146
// Calculate the output size
146147
nBytesOutput = ::GetSerializeSize(CTxOut(0, dummyScript), PROTOCOL_VERSION);
@@ -204,7 +205,7 @@ CTransactionBuilderOutput* CTransactionBuilder::AddOutput(CAmount nAmountOutput)
204205
{
205206
if (CouldAddOutput(nAmountOutput)) {
206207
LOCK(cs_outputs);
207-
vecOutputs.push_back(std::make_unique<CTransactionBuilderOutput>(this, pwallet, nAmountOutput));
208+
vecOutputs.push_back(std::make_unique<CTransactionBuilderOutput>(this, m_wallet, nAmountOutput));
208209
return vecOutputs.back().get();
209210
}
210211
return nullptr;
@@ -233,12 +234,12 @@ CAmount CTransactionBuilder::GetAmountUsed() const
233234
CAmount CTransactionBuilder::GetFee(unsigned int nBytes) const
234235
{
235236
CAmount nFeeCalc = coinControl.m_feerate->GetFee(nBytes);
236-
CAmount nRequiredFee = GetRequiredFee(*pwallet, nBytes);
237+
CAmount nRequiredFee = GetRequiredFee(*m_wallet, nBytes);
237238
if (nRequiredFee > nFeeCalc) {
238239
nFeeCalc = nRequiredFee;
239240
}
240-
if (nFeeCalc > pwallet->m_default_max_tx_fee) {
241-
nFeeCalc = pwallet->m_default_max_tx_fee;
241+
if (nFeeCalc > m_wallet->m_default_max_tx_fee) {
242+
nFeeCalc = m_wallet->m_default_max_tx_fee;
242243
}
243244
return nFeeCalc;
244245
}
@@ -273,9 +274,9 @@ bool CTransactionBuilder::Commit(bilingual_str& strResult)
273274

274275
CTransactionRef tx;
275276
{
276-
LOCK2(pwallet->cs_wallet, cs_main);
277+
LOCK2(m_wallet->cs_wallet, cs_main);
277278
FeeCalculation fee_calc_out;
278-
if (!pwallet->CreateTransaction(vecSend, tx, nFeeRet, nChangePosRet, strResult, coinControl, fee_calc_out)) {
279+
if (!m_wallet->CreateTransaction(vecSend, tx, nFeeRet, nChangePosRet, strResult, coinControl, fee_calc_out)) {
279280
return false;
280281
}
281282
}
@@ -312,8 +313,8 @@ bool CTransactionBuilder::Commit(bilingual_str& strResult)
312313
}
313314

314315
{
315-
LOCK2(pwallet->cs_wallet, cs_main);
316-
pwallet->CommitTransaction(tx, {}, {});
316+
LOCK2(m_wallet->cs_wallet, cs_main);
317+
m_wallet->CommitTransaction(tx, {}, {});
317318
}
318319

319320
fKeepKeys = true;

src/coinjoin/util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CTransactionBuilderOutput
5454
CScript script;
5555

5656
public:
57-
CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, std::shared_ptr<CWallet> pwalletIn, CAmount nAmountIn);
57+
CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, const std::shared_ptr<CWallet>& wallet, CAmount nAmountIn);
5858
CTransactionBuilderOutput(CTransactionBuilderOutput&&) = delete;
5959
CTransactionBuilderOutput& operator=(CTransactionBuilderOutput&&) = delete;
6060
/// Get the scriptPubKey of this output
@@ -77,7 +77,7 @@ class CTransactionBuilderOutput
7777
class CTransactionBuilder
7878
{
7979
/// Wallet the transaction will be build for
80-
std::shared_ptr<CWallet> pwallet;
80+
const std::shared_ptr<CWallet>& m_wallet;
8181
/// See CTransactionBuilder() for initialization
8282
CCoinControl coinControl;
8383
/// Dummy since we anyway use tallyItem's destination as change destination in coincontrol.
@@ -100,7 +100,7 @@ class CTransactionBuilder
100100
friend class CTransactionBuilderOutput;
101101

102102
public:
103-
CTransactionBuilder(std::shared_ptr<CWallet> pwalletIn, const CompactTallyItem& tallyItemIn);
103+
CTransactionBuilder(const std::shared_ptr<CWallet>& wallet, const CompactTallyItem& tallyItemIn);
104104
~CTransactionBuilder();
105105
/// Check it would be possible to add a single output with the amount nAmount. Returns true if its possible and false if not.
106106
bool CouldAddOutput(CAmount nAmountOutput) const EXCLUSIVE_LOCKS_REQUIRED(!cs_outputs);

src/interfaces/coinjoin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Loader
3333
public:
3434
virtual ~Loader() {}
3535
//! Add new wallet to CoinJoin client manager
36-
virtual void AddWallet(CWallet&) = 0;
36+
virtual void AddWallet(const std::shared_ptr<CWallet>&) = 0;
3737
//! Remove wallet from CoinJoin client manager
3838
virtual void RemoveWallet(const std::string&) = 0;
3939
virtual void FlushWallet(const std::string&) = 0;

src/wallet/test/wallet_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ static std::shared_ptr<CWallet> TestLoadWallet(interfaces::Chain* chain, interfa
5959
std::vector<bilingual_str> warnings;
6060
auto database = MakeWalletDatabase("", options, status, error);
6161
auto wallet = CWallet::Create(chain, coinjoin_loader, "", std::move(database), options.create_flags, error, warnings);
62+
if (coinjoin_loader) {
63+
// TODO: see CreateWalletWithoutChain
64+
AddWallet(wallet);
65+
}
6266
if (chain) {
6367
wallet->postInitProcess();
6468
}

src/wallet/wallet.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bool AddWallet(const std::shared_ptr<CWallet>& wallet)
125125
}
126126
wallet->ConnectScriptPubKeyManNotifiers();
127127
wallet->AutoLockMasternodeCollaterals();
128-
wallet->coinjoin_loader().AddWallet(*wallet);
128+
wallet->coinjoin_loader().AddWallet(wallet);
129129
wallet->NotifyCanGetAddressesChanged();
130130
return true;
131131
}
@@ -1432,46 +1432,46 @@ int CWallet::GetRealOutpointCoinJoinRounds(const COutPoint& outpoint, int nRound
14321432
if (wtx == nullptr || wtx->tx == nullptr) {
14331433
// no such tx in this wallet
14341434
*nRoundsRef = -1;
1435-
WalletCJLogPrint((*this), "%s FAILED %-70s %3d\n", __func__, outpoint.ToStringShort(), -1);
1435+
WalletCJLogPrint(this, "%s FAILED %-70s %3d\n", __func__, outpoint.ToStringShort(), -1);
14361436
return *nRoundsRef;
14371437
}
14381438

14391439
// bounds check
14401440
if (outpoint.n >= wtx->tx->vout.size()) {
14411441
// should never actually hit this
14421442
*nRoundsRef = -4;
1443-
WalletCJLogPrint((*this), "%s FAILED %-70s %3d\n", __func__, outpoint.ToStringShort(), -4);
1443+
WalletCJLogPrint(this, "%s FAILED %-70s %3d\n", __func__, outpoint.ToStringShort(), -4);
14441444
return *nRoundsRef;
14451445
}
14461446

14471447
auto txOutRef = &wtx->tx->vout[outpoint.n];
14481448

14491449
if (CoinJoin::IsCollateralAmount(txOutRef->nValue)) {
14501450
*nRoundsRef = -3;
1451-
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1451+
WalletCJLogPrint(this, "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
14521452
return *nRoundsRef;
14531453
}
14541454

14551455
// make sure the final output is non-denominate
14561456
if (!CoinJoin::IsDenominatedAmount(txOutRef->nValue)) { //NOT DENOM
14571457
*nRoundsRef = -2;
1458-
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1458+
WalletCJLogPrint(this, "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
14591459
return *nRoundsRef;
14601460
}
14611461

14621462
for (const auto& out : wtx->tx->vout) {
14631463
if (!CoinJoin::IsDenominatedAmount(out.nValue)) {
14641464
// this one is denominated but there is another non-denominated output found in the same tx
14651465
*nRoundsRef = 0;
1466-
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1466+
WalletCJLogPrint(this, "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
14671467
return *nRoundsRef;
14681468
}
14691469
}
14701470

14711471
// make sure we spent all of it with 0 fee, reset to 0 rounds otherwise
14721472
if (wtx->GetDebit(ISMINE_SPENDABLE) != wtx->GetCredit(ISMINE_SPENDABLE)) {
14731473
*nRoundsRef = 0;
1474-
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1474+
WalletCJLogPrint(this, "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
14751475
return *nRoundsRef;
14761476
}
14771477

@@ -1491,7 +1491,7 @@ int CWallet::GetRealOutpointCoinJoinRounds(const COutPoint& outpoint, int nRound
14911491
*nRoundsRef = fDenomFound
14921492
? (nShortest >= nRoundsMax - 1 ? nRoundsMax : nShortest + 1) // good, we a +1 to the shortest one but only nRoundsMax rounds max allowed
14931493
: 0; // too bad, we are the fist one in that chain
1494-
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1494+
WalletCJLogPrint(this, "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
14951495
return *nRoundsRef;
14961496
}
14971497

@@ -3253,7 +3253,7 @@ bool CWallet::SelectTxDSInsByDenomination(int nDenom, CAmount nValueMax, std::ve
32533253
CCoinControl coin_control;
32543254
coin_control.nCoinType = CoinType::ONLY_READY_TO_MIX;
32553255
AvailableCoins(vCoins, &coin_control);
3256-
WalletCJLogPrint((*this), "CWallet::%s -- vCoins.size(): %d\n", __func__, vCoins.size());
3256+
WalletCJLogPrint(this, "CWallet::%s -- vCoins.size(): %d\n", __func__, vCoins.size());
32573257

32583258
Shuffle(vCoins.rbegin(), vCoins.rend(), FastRandomContext());
32593259

@@ -3271,11 +3271,11 @@ bool CWallet::SelectTxDSInsByDenomination(int nDenom, CAmount nValueMax, std::ve
32713271
nValueTotal += nValue;
32723272
vecTxDSInRet.emplace_back(CTxDSIn(txin, scriptPubKey, nRounds));
32733273
setRecentTxIds.emplace(txHash);
3274-
WalletCJLogPrint((*this), "CWallet::%s -- hash: %s, nValue: %d.%08d\n",
3274+
WalletCJLogPrint(this, "CWallet::%s -- hash: %s, nValue: %d.%08d\n",
32753275
__func__, txHash.ToString(), nValue / COIN, nValue % COIN);
32763276
}
32773277

3278-
WalletCJLogPrint((*this), "CWallet::%s -- setRecentTxIds.size(): %d\n", __func__, setRecentTxIds.size());
3278+
WalletCJLogPrint(this, "CWallet::%s -- setRecentTxIds.size(): %d\n", __func__, setRecentTxIds.size());
32793279

32803280
return nValueTotal > 0;
32813281
}
@@ -4980,7 +4980,7 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain* chain, interfaces::C
49804980
}
49814981

49824982
if (coinjoin_loader) {
4983-
coinjoin_loader->AddWallet(*walletInstance);
4983+
coinjoin_loader->AddWallet(walletInstance);
49844984
}
49854985

49864986
{

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ extern const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS;
153153
#define WalletCJLogPrint(wallet, ...) \
154154
do { \
155155
if (LogAcceptCategory(BCLog::COINJOIN)) { \
156-
wallet.WalletLogPrintf(__VA_ARGS__); \
156+
wallet->WalletLogPrintf(__VA_ARGS__); \
157157
} \
158158
} while (0)
159159

0 commit comments

Comments
 (0)