From 9c0fceb1920731678ffc6248e197eb2dd19c872d Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Mon, 1 Jan 2018 20:49:32 -0800 Subject: [PATCH] Problem: sending any Whisper message fails The error is "PoW too low to compete with other messages" This has been previously reported in #7144 Solution: prevent the move semantics The source of the error is in PoolHandle.relay implementation for NetPoolHandle. Because of the move semantics, `res` variable is in fact copied (as it implements Copy) into the closure and for that reason, the returned result is always `false. --- parity/whisper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity/whisper.rs b/parity/whisper.rs index f8d33626b..ed4812063 100644 --- a/parity/whisper.rs +++ b/parity/whisper.rs @@ -51,7 +51,7 @@ impl PoolHandle for NetPoolHandle { fn relay(&self, message: Message) -> bool { let mut res = false; let mut message = Some(message); - self.net.with_proto_context(whisper_net::PROTOCOL_ID, &mut move |ctx| { + self.net.with_proto_context(whisper_net::PROTOCOL_ID, &mut |ctx| { if let Some(message) = message.take() { res = self.handle.post_message(message, ctx); }