Browse Source

thread-safety fix

cl-refactor
subtly 10 years ago
parent
commit
345416e7d7
  1. 6
      libwhisper/WhisperPeer.cpp

6
libwhisper/WhisperPeer.cpp

@ -82,10 +82,8 @@ bool WhisperPeer::interpret(unsigned _id, RLP const& _r)
void WhisperPeer::sendMessages()
{
if (m_unseen.size())
{
RLPStream amalg;
unsigned msgCount;
unsigned msgCount = 0;
{
Guard l(x_unseen);
msgCount = m_unseen.size();
@ -97,6 +95,8 @@ void WhisperPeer::sendMessages()
}
}
if (msgCount)
{
RLPStream s;
prep(s, MessagesPacket, msgCount).appendRaw(amalg.out(), msgCount);
sealAndSend(s);

Loading…
Cancel
Save