Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging for consolidation addrs #3120

Merged
merged 8 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/dfi/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <validation.h>

#include <consensus/params.h>
#include <logging.h>
#include <boost/asio.hpp>

#define MILLI 0.001
Expand Down Expand Up @@ -1573,6 +1574,14 @@ void ConsolidateRewards(CCustomCSView &view,

LogPrintf("%s: address count: %d concurrency: %d\n", __func__, owners.size(), nWorkers);

if (LogAcceptCategory(BCLog::ACCOUNTCONSOLIDATE)) {
UniValue logAddrJsonArr(UniValue::VARR);
for (auto &owner : owners) {
logAddrJsonArr.push_back(ScriptToString(owner));
}
LogPrintf("%s: addrs: %s\n", __func__, logAddrJsonArr.write(2));
}

for (auto &owner : owners) {
// See https://github.com/DeFiCh/ain/pull/1291
// https://github.com/DeFiCh/ain/pull/1291#issuecomment-1137638060
Expand Down
1 change: 1 addition & 0 deletions src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const CLogCategoryDesc LogCategories[] =
{BCLog::CONNECT, "connect"},
{BCLog::OCEAN, "ocean"},
{BCLog::ICXBUG, "icxbug"},
{BCLog::ACCOUNTCONSOLIDATE, "accountconsolidate"},
{BCLog::ALL, "1"},
{BCLog::ALL, "all"},
};
Expand Down
75 changes: 38 additions & 37 deletions src/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,44 @@ struct CLogCategoryActive

namespace BCLog {
enum LogFlags : uint64_t {
NONE = 0ull,
NET = (1ull << 0ull),
TOR = (1ull << 1ull),
MEMPOOL = (1ull << 2ull),
HTTP = (1ull << 3ull),
BENCH = (1ull << 4ull),
ZMQ = (1ull << 5ull),
DB = (1ull << 6ull),
RPC = (1ull << 7ull),
ESTIMATEFEE = (1ull << 8ull),
ADDRMAN = (1ull << 9ull),
SELECTCOINS = (1ull << 10ull),
REINDEX = (1ull << 11ull),
CMPCTBLOCK = (1ull << 12ull),
RAND = (1ull << 13ull),
PRUNE = (1ull << 14ull),
PROXY = (1ull << 15ull),
MEMPOOLREJ = (1ull << 16ull),
LIBEVENT = (1ull << 17ull),
COINDB = (1ull << 18ull),
LEVELDB = (1ull << 20ull),
STAKING = (1ull << 21ull),
ANCHORING = (1ull << 22ull),
SPV = (1ull << 23ull),
ORACLE = (1ull << 24ull),
LOAN = (1ull << 25ull),
ACCOUNTCHANGE = (1ull << 26ull),
FUTURESWAP = (1ull << 27ull),
TOKENSPLIT = (1ull << 28ull),
RPCCACHE = (1ull << 29ull),
CUSTOMTXBENCH = (1ull << 30ull),
CONNECT = (1ull << 31ull),
SIGN = (1ull << 32ull),
SWAPRESULT = (1ull << 33ull),
OCEAN = (1ull << 34ull),
ICXBUG = (1ull << 35ull),
ALL = ~(0ull),
NONE = 0ull,
NET = (1ull << 0ull),
TOR = (1ull << 1ull),
MEMPOOL = (1ull << 2ull),
HTTP = (1ull << 3ull),
BENCH = (1ull << 4ull),
ZMQ = (1ull << 5ull),
DB = (1ull << 6ull),
RPC = (1ull << 7ull),
ESTIMATEFEE = (1ull << 8ull),
ADDRMAN = (1ull << 9ull),
SELECTCOINS = (1ull << 10ull),
REINDEX = (1ull << 11ull),
CMPCTBLOCK = (1ull << 12ull),
RAND = (1ull << 13ull),
PRUNE = (1ull << 14ull),
PROXY = (1ull << 15ull),
MEMPOOLREJ = (1ull << 16ull),
LIBEVENT = (1ull << 17ull),
COINDB = (1ull << 18ull),
LEVELDB = (1ull << 20ull),
STAKING = (1ull << 21ull),
ANCHORING = (1ull << 22ull),
SPV = (1ull << 23ull),
ORACLE = (1ull << 24ull),
LOAN = (1ull << 25ull),
ACCOUNTCHANGE = (1ull << 26ull),
FUTURESWAP = (1ull << 27ull),
TOKENSPLIT = (1ull << 28ull),
RPCCACHE = (1ull << 29ull),
CUSTOMTXBENCH = (1ull << 30ull),
CONNECT = (1ull << 31ull),
SIGN = (1ull << 32ull),
SWAPRESULT = (1ull << 33ull),
OCEAN = (1ull << 34ull),
ICXBUG = (1ull << 35ull),
ACCOUNTCONSOLIDATE = (1ull << 36ull),
ALL = ~(0ull),
};

class Logger
Expand Down
Loading