File tree 2 files changed +7
-2
lines changed
src/main/java/com/rampatra/blockchain
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
package com .rampatra .blockchain ;
2
2
3
+ import sun .net .ConnectionResetException ;
4
+
3
5
import java .io .IOException ;
4
6
import java .io .ObjectInputStream ;
5
7
import java .io .ObjectOutputStream ;
6
8
import java .net .Socket ;
9
+ import java .net .SocketException ;
7
10
8
11
/**
9
12
* @author rampatra
@@ -35,7 +38,9 @@ public void run() {
35
38
in .close ();
36
39
out .close ();
37
40
} catch (Exception e ) {
38
- throw new RuntimeException (e );
41
+ if (!(e instanceof SocketException )) {
42
+ throw new RuntimeException (e );
43
+ }
39
44
}
40
45
}
41
46
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public static void showPeers() {
61
61
62
62
public static void showPeersWithBlockchain () {
63
63
for (int i = 0 ; i < peers .size (); i ++) {
64
- System .out .println ("Peer " + (i + 1 ) + ": " + peers .get (i ).getBlockchain ());
64
+ System .out .println ("Peer " + (i + 1 ) + " (" + peers . get ( i ). getPort () + ") : " + peers .get (i ).getBlockchain ());
65
65
}
66
66
}
67
67
}
You can’t perform that action at this time.
0 commit comments