From 7942e862b8432838bbafc3f121ac96cff233668a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 6 Feb 2019 22:01:40 +0000 Subject: [PATCH] blockchain: include number of discarded blocks in --reorg-notify --- src/cryptonote_core/blockchain.cpp | 3 ++- src/cryptonote_core/cryptonote_core.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index a0a1e3935..3a4b7f514 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1019,6 +1019,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::list reorg_notify = m_reorg_notify; if (reorg_notify) reorg_notify->notify("%s", std::to_string(split_height).c_str(), "%h", std::to_string(m_db->height()).c_str(), - "%n", std::to_string(m_db->height() - split_height).c_str(), NULL); + "%n", std::to_string(m_db->height() - split_height).c_str(), "%d", std::to_string(discarded_blocks).c_str(), NULL); MGINFO_GREEN("REORGANIZE SUCCESS! on height: " << split_height << ", new blockchain size: " << m_db->height()); return true; diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c9ec05ee6..6feed800e 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -176,8 +176,9 @@ namespace cryptonote static const command_line::arg_descriptor arg_reorg_notify = { "reorg-notify" , "Run a program for each reorg, '%s' will be replaced by the split height, " - "'%h' will be replaced by the new blockchain height, and '%n' will be " - "replaced by the number of new blocks in the new chain" + "'%h' will be replaced by the new blockchain height, '%n' will be " + "replaced by the number of new blocks in the new chain, and '%d' will be " + "replaced by the number of blocks discarded from the old chain" , "" }; static const command_line::arg_descriptor arg_block_rate_notify = {