From 6e9a3979d2b0112326581685e2c0f71c96385d62 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 f8d33626bcf..ed4812063d6 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); }