aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-10-04 13:49:44 -0400
committerMatt Corallo <git@bluematt.me>2016-10-04 13:49:44 -0400
commitfef1010199b70026fd6d56ebac5c277552757307 (patch)
tree9590c91b21f6b1a3a3c36d9463f197725d4d8e3d /src/main.h
parentaefcb7b70c923ccd341329a2d5e22238dc14ac3b (diff)
downloadbitcoin-fef1010199b70026fd6d56ebac5c277552757307.tar.xz
Use CValidationInterface from chain logic to notify peer logic
This adds a new CValidationInterface subclass, defined in main.h, to receive notifications of UpdatedBlockTip and use that to push blocks to peers, instead of doing it directly from ActivateBestChain.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h
index 3c587569f6..bb5e26b0b2 100644
--- a/src/main.h
+++ b/src/main.h
@@ -16,6 +16,7 @@
#include "net.h"
#include "script/script_error.h"
#include "sync.h"
+#include "validationinterface.h"
#include "versionbits.h"
#include <algorithm>
@@ -527,6 +528,16 @@ void RegisterNodeSignals(CNodeSignals& nodeSignals);
/** Unregister a network node */
void UnregisterNodeSignals(CNodeSignals& nodeSignals);
+class PeerLogicValidation : public CValidationInterface {
+private:
+ CConnman* connman;
+
+public:
+ PeerLogicValidation(CConnman* connmanIn) : connman(connmanIn) {}
+
+ virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
+};
+
struct CNodeStateStats {
int nMisbehavior;
int nSyncHeight;