mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 18:00:39 +01:00
Minor reformatting
This commit is contained in:
parent
c5f8135f60
commit
dd47862829
@ -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());
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user