Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Problem: sending any Whisper message fails
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yrashk committed Jan 2, 2018
1 parent 51e6e0b commit 9c0fceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parity/whisper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9c0fceb

Please sign in to comment.