mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
cmd/devp2p: fix getblockbodies request id error
Include the actual and expected request IDs in the GetBlockBodies response failure message. This also fixes the typo in the diagnostic so mismatched responses report a useful error.
This commit is contained in:
parent
1f87331fbc
commit
74b9c963d0
1 changed files with 1 additions and 1 deletions
|
|
@ -413,7 +413,7 @@ func (s *Suite) TestGetBlockBodies(t *utesting.T) {
|
||||||
t.Fatalf("error reading block bodies msg: %v", err)
|
t.Fatalf("error reading block bodies msg: %v", err)
|
||||||
}
|
}
|
||||||
if got, want := resp.RequestId, req.RequestId; got != want {
|
if got, want := resp.RequestId, req.RequestId; got != want {
|
||||||
t.Fatalf("unexpected request id in respond", got, want)
|
t.Fatalf("unexpected request id in response: got %d, want %d", got, want)
|
||||||
}
|
}
|
||||||
if resp.List.Len() != len(req.GetBlockBodiesRequest) {
|
if resp.List.Len() != len(req.GetBlockBodiesRequest) {
|
||||||
t.Fatalf("wrong bodies in response: expected %d bodies, got %d", len(req.GetBlockBodiesRequest), resp.List.Len())
|
t.Fatalf("wrong bodies in response: expected %d bodies, got %d", len(req.GetBlockBodiesRequest), resp.List.Len())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue