Browse Source

Protocol bump for shh.

cl-refactor
Gav Wood 10 years ago
parent
commit
038b865baa
  1. 2
      libwhisper/WhisperHost.h
  2. 4
      libwhisper/WhisperPeer.cpp
  3. 2
      libwhisper/WhisperPeer.h

2
libwhisper/WhisperHost.h

@ -46,7 +46,7 @@ public:
WhisperHost();
virtual ~WhisperHost();
unsigned protocolVersion() const { return 0; }
unsigned protocolVersion() const { return 1; }
virtual void inject(Envelope const& _e, WhisperPeer* _from = nullptr) override;

4
libwhisper/WhisperPeer.cpp

@ -37,7 +37,7 @@ using namespace dev::shh;
WhisperPeer::WhisperPeer(Session* _s, HostCapabilityFace* _h, unsigned _i): Capability(_s, _h, _i)
{
RLPStream s;
sealAndSend(prep(s, StatusPacket, 1) << host()->protocolVersion());
sealAndSend(prep(s, StatusPacket, 1) << version());
}
WhisperPeer::~WhisperPeer()
@ -59,7 +59,7 @@ bool WhisperPeer::interpret(unsigned _id, RLP const& _r)
clogS(NetMessageSummary) << "Status: " << protocolVersion;
if (protocolVersion != host()->protocolVersion())
if (protocolVersion != version())
disable("Invalid protocol version.");
if (session()->id() < host()->host()->id())

2
libwhisper/WhisperPeer.h

@ -53,7 +53,7 @@ public:
virtual ~WhisperPeer();
static std::string name() { return "shh"; }
static u256 version() { return 1; }
static u256 version() { return 2; }
static unsigned messageCount() { return PacketCount; }
WhisperHost* host() const;

Loading…
Cancel
Save