Skip to content

Commit 5cb4c1c

Browse files
committed
Add PPLNS distribution debug log (periodic, every ~5 min)
1 parent cd32e10 commit 5cb4c1c

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/core/web_server.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,22 @@ void MiningInterface::refresh_work()
14151415

14161416
auto expected = m_pplns_fn(best, block_target, coinbase_value, m_donation_script);
14171417

1418+
// Debug: log PPLNS distribution
1419+
{
1420+
static int pplns_log = 0;
1421+
if (pplns_log++ % 60 == 0) { // every ~5 min (60 * 5s interval)
1422+
LOG_INFO << "[PPLNS] " << expected.size() << " addrs, subsidy=" << coinbase_value;
1423+
for (const auto& [script, amount] : expected) {
1424+
uint64_t sat = static_cast<uint64_t>(amount);
1425+
LOG_INFO << "[PPLNS] script(" << script.size() << ")="
1426+
<< (script.size() > 4 ? HexStr(std::span<const unsigned char>(
1427+
reinterpret_cast<const unsigned char*>(script.data()),
1428+
std::min(script.size(), size_t(10)))) : "?")
1429+
<< "... amount=" << sat;
1430+
}
1431+
}
1432+
}
1433+
14181434
if (!expected.empty()) {
14191435
static const char* HEX = "0123456789abcdef";
14201436

0 commit comments

Comments
 (0)