mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +00:00
Fix FakeChannelSink so events are put into the queue in the right order (BEFORE running event handlers, not after).
This commit is contained in:
parent
7bfef81664
commit
e20c35bf50
@ -1,18 +1,19 @@
|
||||
package com.google.bitcoin.core;
|
||||
|
||||
import static org.jboss.netty.channel.Channels.fireChannelConnected;
|
||||
|
||||
import org.jboss.netty.channel.*;
|
||||
|
||||
import static org.jboss.netty.channel.Channels.fireChannelConnected;
|
||||
|
||||
public class FakeChannelSink extends AbstractChannelSink {
|
||||
|
||||
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e)
|
||||
throws Exception {
|
||||
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws Exception {
|
||||
if (e instanceof ChannelStateEvent) {
|
||||
ChannelStateEvent event = (ChannelStateEvent) e;
|
||||
|
||||
FakeChannel channel =
|
||||
(FakeChannel) event.getChannel();
|
||||
FakeChannel channel = (FakeChannel) event.getChannel();
|
||||
boolean offered = channel.events.offer(event);
|
||||
assert offered;
|
||||
|
||||
ChannelFuture future = event.getFuture();
|
||||
ChannelState state = event.getState();
|
||||
Object value = event.getValue();
|
||||
@ -42,8 +43,6 @@ public class FakeChannelSink extends AbstractChannelSink {
|
||||
future.setSuccess();
|
||||
break;
|
||||
}
|
||||
boolean offered = channel.events.offer(event);
|
||||
assert offered;
|
||||
} else if (e instanceof MessageEvent) {
|
||||
MessageEvent event = (MessageEvent) e;
|
||||
FakeChannel channel = (FakeChannel) event.getChannel();
|
||||
|
Loading…
Reference in New Issue
Block a user