Minor reformatting

This commit is contained in:
Mike Hearn 2012-10-23 20:35:55 +02:00
parent c5f8135f60
commit dd47862829
2 changed files with 4 additions and 9 deletions

View File

@ -157,15 +157,13 @@ public class Peer {
class PeerHandler extends SimpleChannelHandler {
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception {
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
super.channelClosed(ctx, e);
notifyDisconnect();
}
@Override
public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception {
public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
super.connectRequested(ctx, e);
channel = e.getChannel();
address = new PeerAddress((InetSocketAddress)e.getValue());
@ -173,8 +171,7 @@ public class Peer {
/** Catch any exceptions, logging them and then closing the channel. */
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
throws Exception {
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
if (e.getCause() instanceof ConnectException || e.getCause() instanceof IOException) {
// Short message for network errors
log.info(toString() + " - " + e.getCause().getMessage());

View File

@ -202,9 +202,7 @@ public class PeerGroup {
Peer peer = new Peer(params, chain, ver);
peer.addLifecycleListener(startupListener);
pendingPeers.add(peer);
TCPNetworkConnection codec =
new TCPNetworkConnection(params,
peer.getVersionMessage());
TCPNetworkConnection codec = new TCPNetworkConnection(params, peer.getVersionMessage());
p.addLast("codec", codec.getHandler());
p.addLast("peer", peer.getHandler());
return p;