aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-09 14:29:28 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-28 19:32:31 +0000
commit23813c7160fa1236cc882cae0ae40f3bee339f91 (patch)
treeaab77e7ef5cde1080c7da9a2b15b1abe63710719 /src/cryptonote_core/blockchain.h
parentnotify: handle arbitrary tags (diff)
downloadmonero-23813c7160fa1236cc882cae0ae40f3bee339f91.tar.xz
blockchain: add --reorg-notify
This will trigger if a reorg is seen. This may be used to do things like stop automated withdrawals on large reorgs. %s is replaced by the height at the split point %h is replaced by the height of the new chain %n is replaced by the number of new blocks after the reorg
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r--src/cryptonote_core/blockchain.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 4952116ac..c742bec91 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -731,11 +731,18 @@ namespace cryptonote
/**
* @brief sets a block notify object to call for every new block
*
- * @param notify the notify object to cal at every new block
+ * @param notify the notify object to call at every new block
*/
void set_block_notify(const std::shared_ptr<tools::Notify> &notify) { m_block_notify = notify; }
/**
+ * @brief sets a reorg notify object to call for every reorg
+ *
+ * @param notify the notify object to call at every reorg
+ */
+ void set_reorg_notify(const std::shared_ptr<tools::Notify> &notify) { m_reorg_notify = notify; }
+
+ /**
* @brief Put DB in safe sync mode
*/
void safesyncmode(const bool onoff);
@@ -1077,6 +1084,7 @@ namespace cryptonote
bool m_btc_valid;
std::shared_ptr<tools::Notify> m_block_notify;
+ std::shared_ptr<tools::Notify> m_reorg_notify;
/**
* @brief collects the keys for all outputs being "spent" as an input