Skip to content

Commit 35e8308

Browse files
committed
eth, les: shorten genesis block mismatch error message
1 parent fc97c7a commit 35e8308

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎eth/peer.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (p *peer) readStatus(network int, status *statusData, genesis common.Hash)
280280
return errResp(ErrDecode, "msg %v: %v", msg, err)
281281
}
282282
if status.GenesisBlock != genesis {
283-
return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", status.GenesisBlock, genesis)
283+
return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", status.GenesisBlock[:8], genesis[:8])
284284
}
285285
if int(status.NetworkId) != network {
286286
return errResp(ErrNetworkIdMismatch, "%d (!= %d)", status.NetworkId, network)

‎eth/protocol_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
6363
},
6464
{
6565
code: StatusMsg, data: statusData{uint32(protocol), NetworkId, td, currentBlock, common.Hash{3}},
66-
wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000000000000000000000000000000000000000000000000000 (!= %x)", genesis),
66+
wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000 (!= %x)", genesis[:8]),
6767
},
6868
}
6969

‎les/peer.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func (p *peer) Handshake(td *big.Int, head common.Hash, headNum uint64, genesis
367367
}
368368

369369
if rGenesis != genesis {
370-
return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", rGenesis, genesis)
370+
return errResp(ErrGenesisBlockMismatch, "%x (!= %x)", rGenesis[:8], genesis[:8])
371371
}
372372
if int(rNetwork) != p.network {
373373
return errResp(ErrNetworkIdMismatch, "%d (!= %d)", rNetwork, p.network)

0 commit comments

Comments
 (0)