minor fix

This commit is contained in:
romanman 2014-05-22 23:14:04 +03:00
parent 7aaf35c770
commit a24496115a
3 changed files with 13 additions and 4 deletions

View File

@ -34,11 +34,11 @@ public class PeersTableWindow extends JFrame{
// Constructor of main frame
public PeersTableWindow() {
// Set the frame characteristics
setTitle("Ethereum Peers");
setSize(355, 300);
setLocation(815, 80);
setBackground(Color.gray);
java.net.URL url = ClassLoader.getSystemResource("ethereum-icon.png");
Toolkit kit = Toolkit.getDefaultToolkit();
@ -48,7 +48,10 @@ public class PeersTableWindow extends JFrame{
// Create a panel to hold all other components
topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
topPanel.setBackground(Color.WHITE);
getContentPane().add(topPanel);
getContentPane().setBackground(Color.WHITE);
// Create a new table instance
table = new JTable();
@ -73,8 +76,14 @@ public class PeersTableWindow extends JFrame{
table.setRowMargin(3);
table.setRowHeight(50);
table.setShowHorizontalLines(true);
table.setShowVerticalLines(true);
table.setGridColor(new Color(230, 230, 230));
// Add the table to a scrolling pane
scrollPane = new JScrollPane(table);
scrollPane.getViewport().setBackground(Color.WHITE);
topPanel.add(scrollPane, BorderLayout.CENTER);
updater.scheduleAtFixedRate(new TimerTask() {

View File

@ -15,7 +15,7 @@ public class StaticMessages {
public static final byte[] GET_PEERS = Hex.decode("2240089100000002C110");
public static final byte[] GET_TRANSACTIONS = Hex.decode("2240089100000002C116");
public static final byte[] DISCONNECT_00 = Hex.decode("2240089100000003C20100");
public static final byte[] DISCONNECT_08 = Hex.decode("2240089100000003C20108");
public static final byte[] GENESIS_HASH = Hex.decode("c305511e7cb9b33767e50f5e94ecd7b1c51359a04f45183860ec6808d80b0d3f");
public static final byte[] MAGIC_PACKET = Hex.decode("22400891");

View File

@ -191,8 +191,8 @@ public class EthereumPeerTasterHandler extends ChannelInboundHandlerAdapter {
private void sendDisconnectNice(ChannelHandlerContext ctx){
logger.info("[Send: DISCONNECT]");
ByteBuf buffer = ctx.alloc().buffer(StaticMessages.DISCONNECT_00.length);
buffer.writeBytes(StaticMessages.DISCONNECT_00);
ByteBuf buffer = ctx.alloc().buffer(StaticMessages.DISCONNECT_08.length);
buffer.writeBytes(StaticMessages.DISCONNECT_08);
ctx.writeAndFlush(buffer);
}