From 35e8308bf76df11c3c1e8d11fac782814583ea5c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 27 Feb 2017 13:53:30 +0100 Subject: [PATCH] eth, les: shorten genesis block mismatch error message --- eth/peer.go | 2 +- eth/protocol_test.go | 2 +- les/peer.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/peer.go b/eth/peer.go index fcf528af65..e87438953f 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -280,7 +280,7 @@ func (p *peer) readStatus(network int, status *statusData, genesis common.Hash) return errResp(ErrDecode, "msg %v: %v", msg, err) } if status.GenesisBlock != genesis { - return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", status.GenesisBlock, genesis) + return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", status.GenesisBlock[:8], genesis[:8]) } if int(status.NetworkId) != network { return errResp(ErrNetworkIdMismatch, "%d (!= %d)", status.NetworkId, network) diff --git a/eth/protocol_test.go b/eth/protocol_test.go index 43f336c320..253dcd8a7f 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -63,7 +63,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) { }, { code: StatusMsg, data: statusData{uint32(protocol), NetworkId, td, currentBlock, common.Hash{3}}, - wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000000000000000000000000000000000000000000000000000 (!= %x)", genesis), + wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000 (!= %x)", genesis[:8]), }, } diff --git a/les/peer.go b/les/peer.go index fc3591c781..4d00f3df9b 100644 --- a/les/peer.go +++ b/les/peer.go @@ -367,7 +367,7 @@ func (p *peer) Handshake(td *big.Int, head common.Hash, headNum uint64, genesis } if rGenesis != genesis { - return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", rGenesis, genesis) + return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", rGenesis[:8], genesis[:8]) } if int(rNetwork) != p.network { return errResp(ErrNetworkIdMismatch, "%d (!= %d)", rNetwork, p.network)