Skip to content

Commit

Permalink
suggestions by ai bot
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Feb 23, 2025
1 parent 6ec6a8b commit 71659ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/interfaces/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace interfaces {
std::unique_ptr<Node> Init::makeNode() { return {}; }
std::unique_ptr<Chain> Init::makeChain() { return {}; }
std::unique_ptr<CoinJoin::Loader> Init::makeCoinJoinLoader() { return {}; };
std::unique_ptr<CoinJoin::Loader> Init::makeCoinJoinLoader() { return {}; }
std::unique_ptr<WalletLoader> Init::makeWalletLoader(Chain& chain, CoinJoin::Loader& coinjoin_loader) { return {}; }
std::unique_ptr<Echo> Init::makeEcho() { return {}; }
Ipc* Init::ipc() { return nullptr; }
Expand Down
7 changes: 7 additions & 0 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,21 @@ void WalletInit::InitCoinJoinSettings(interfaces::CoinJoin::Loader& coinjoin_loa
const auto& wallets{wallet_loader.getWallets()};
CCoinJoinClientOptions::SetEnabled(!wallets.empty() ? gArgs.GetBoolArg("-enablecoinjoin", true) : false);
if (!CCoinJoinClientOptions::IsEnabled()) {
LogPrintf("CoinJoin: disabled\n");
return;
}
bool fAutoStart = gArgs.GetBoolArg("-coinjoinautostart", DEFAULT_COINJOIN_AUTOSTART);
for (auto& wallet : wallets) {
auto manager = Assert(coinjoin_loader.GetClient(wallet->getWalletName()));
if (!manager) {
LogPrintf("CoinJoin: failed to initialize client for wallet %s\n", wallet->getWalletName());
continue;
}
if (wallet->isLocked(/*fForMixing=*/false)) {
LogPrintf("CoinJoin: stopping mixing for locked wallet %s\n", wallet->getWalletName());
manager->stopMixing();
} else if (fAutoStart) {
LogPrintf("CoinJoin: starting mixing for wallet %s\n", wallet->getWalletName());
manager->startMixing();
}
}
Expand Down

0 comments on commit 71659ff

Please sign in to comment.