Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
7e41653a
Commit
7e41653a
authored
May 06, 2018
by
asynchronous rob
Browse files
don't return async::notready for messages without scheduling wakeup
parent
a80e9be3
Changes
1
Hide whitespace changes
Inline
Side-by-side
consensus/src/service.rs
View file @
7e41653a
...
...
@@ -108,22 +108,22 @@ impl Stream for Messages {
}
// check the network
match
self
.network_stream
.poll
()
{
Err
(
_
)
=>
Err
(
bft
::
InputStreamConcluded
.into
()),
Ok
(
Async
::
NotReady
)
=>
Ok
(
Async
::
NotReady
),
Ok
(
Async
::
Ready
(
None
))
=>
Ok
(
Async
::
NotReady
),
// the input stream for agreements is never meant to logically end.
Ok
(
Async
::
Ready
(
Some
(
message
)))
=>
{
if
message
.parent_hash
==
self
.parent_hash
{
match
process_message
(
message
,
&
self
.authorities
)
{
Ok
(
message
)
=>
Ok
(
Async
::
Ready
(
Some
(
message
))),
Err
(
e
)
=>
{
debug!
(
"Message validation failed: {:?}"
,
e
);
Ok
(
Async
::
NotReady
)
loop
{
match
self
.network_stream
.poll
()
{
Err
(
_
)
=>
return
Err
(
bft
::
InputStreamConcluded
.into
()),
Ok
(
Async
::
NotReady
)
=>
return
Ok
(
Async
::
NotReady
),
Ok
(
Async
::
Ready
(
None
))
=>
return
Ok
(
Async
::
NotReady
),
// the input stream for agreements is never meant to logically end.
Ok
(
Async
::
Ready
(
Some
(
message
)))
=>
{
if
message
.parent_hash
==
self
.parent_hash
{
match
process_message
(
message
,
&
self
.authorities
)
{
Ok
(
message
)
=>
return
Ok
(
Async
::
Ready
(
Some
(
message
))),
Err
(
e
)
=>
{
debug!
(
"Message validation failed: {:?}"
,
e
);
}
}
}
else
{
self
.collection
.push
(
message
);
}
}
else
{
self
.collection
.push
(
message
);
Ok
(
Async
::
NotReady
)
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment