Skip to content

Commit 9cdb0cf

Browse files
committed
Add p2pool-style confirmation/orphan banners to logs
Block verification results now display prominent banners: +++ BLOCK CONFIRMED +++ Height: 4607640 Block hash: 05ae900882314666... Verified: check #1 (10s after submission) --- BLOCK ORPHANED --- Height: 4607640 Block hash: 43f35be9a61d2b8e... Checked: 3 times over 120s — not in best chain Includes full block hash and time since submission for operational visibility.
1 parent f6bc91d commit 9cdb0cf

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

src/core/web_server.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,14 +2403,22 @@ void MiningInterface::verify_found_block(size_t index)
24032403

24042404
if (result > 0) {
24052405
blk.status = BlockStatus::confirmed;
2406-
LOG_INFO << "Block CONFIRMED: height=" << blk.height
2407-
<< " hash=" << blk.hash.substr(0, 16) << "..."
2408-
<< " (check #" << (int)blk.check_count << ")";
2406+
auto age_sec = static_cast<uint64_t>(std::time(nullptr)) - blk.ts;
2407+
LOG_INFO << "\n"
2408+
<< " +++ BLOCK CONFIRMED +++\n"
2409+
<< " Height: " << blk.height << "\n"
2410+
<< " Block hash: " << blk.hash << "\n"
2411+
<< " Verified: check #" << (int)blk.check_count
2412+
<< " (" << age_sec << "s after submission)";
24092413
} else if (result < 0 || blk.check_count >= 3) {
24102414
blk.status = BlockStatus::orphaned;
2411-
LOG_WARNING << "Block ORPHANED: height=" << blk.height
2412-
<< " hash=" << blk.hash.substr(0, 16) << "..."
2413-
<< " (check #" << (int)blk.check_count << ")";
2415+
auto age_sec = static_cast<uint64_t>(std::time(nullptr)) - blk.ts;
2416+
LOG_WARNING << "\n"
2417+
<< " --- BLOCK ORPHANED ---\n"
2418+
<< " Height: " << blk.height << "\n"
2419+
<< " Block hash: " << blk.hash << "\n"
2420+
<< " Checked: " << (int)blk.check_count
2421+
<< " times over " << age_sec << "s — not in best chain";
24142422
}
24152423
}
24162424

0 commit comments

Comments
 (0)