diff options
| author | Ross Nicoll <[email protected]> | 2018-04-22 17:19:03 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 22:11:47 +0100 |
| commit | 41c868f47e671dc5009cd47496c39c13ae36306b (patch) | |
| tree | e48b4f07bce4ff5aac8369551032dc46c46a8bf1 /src/net.h | |
| parent | Update or eliminate remaining tests (#1483) (diff) | |
| download | discoin-41c868f47e671dc5009cd47496c39c13ae36306b.tar.xz discoin-41c868f47e671dc5009cd47496c39c13ae36306b.zip | |
Re-introduce alert functionality (#1470)
Re-introduce alert functionality removed from Bitcoin upstream
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -8,6 +8,7 @@ #include "addrdb.h" #include "addrman.h" +#include "alert.h" #include "amount.h" #include "bloom.h" #include "compat.h" @@ -680,6 +681,9 @@ public: CAmount lastSentFeeFilter; int64_t nextSendTimeFeeFilter; + // Alert relay + std::vector<CAlert> vAlertToSend; + CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const std::string &addrNameIn = "", bool fInboundIn = false); ~CNode(); @@ -769,6 +773,14 @@ public: } } + void PushAlert(const CAlert& _alert) + { + // don't relay to nodes which haven't sent their version message + if (_alert.IsInEffect() && nVersion != 0) { + vAlertToSend.push_back(_alert); + } + } + void AddInventoryKnown(const CInv& inv) { @@ -790,6 +802,12 @@ public: } } + void PushAlertHash(const uint256 &hash) + { + LOCK(cs_inventory); + vBlockHashesToAnnounce.push_back(hash); + } + void PushBlockHash(const uint256 &hash) { LOCK(cs_inventory); |