Browse Source

fix #1366

cl-refactor
subtly 10 years ago
parent
commit
50f78c6eb0
  1. 10
      libwhisper/WhisperHost.cpp

10
libwhisper/WhisperHost.cpp

@ -82,10 +82,10 @@ void WhisperHost::inject(Envelope const& _m, WhisperPeer* _p)
// TODO p2p: capability-based rating
for (auto i: peerSessions())
{
auto w = i.first->cap<WhisperPeer>().get();
if (w == _p)
auto w = i.first->cap<WhisperPeer>();
if (!!w && w.get() == _p)
w->addRating(1);
else
else if(!!w)
w->noteNewMessage(h, _m);
}
}
@ -163,7 +163,9 @@ void WhisperHost::uninstallWatch(unsigned _i)
void WhisperHost::doWork()
{
for (auto& i: peerSessions())
i.first->cap<WhisperPeer>().get()->sendMessages();
if (auto w = i.first->cap<WhisperPeer>())
if (!!w)
i.first->cap<WhisperPeer>()->sendMessages();
cleanup();
}

Loading…
Cancel
Save