From c5d513e96d0e8793ef7b56768868b3625a58527f Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Wed, 23 Jan 2019 15:25:44 -0600 Subject: [PATCH] fix index out of range on lightSync; hopefully the new integration tests will catch them next time :) --- pkg/geth/client/rpc_client.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/geth/client/rpc_client.go b/pkg/geth/client/rpc_client.go index e2adf7c5..76c84494 100644 --- a/pkg/geth/client/rpc_client.go +++ b/pkg/geth/client/rpc_client.go @@ -45,11 +45,15 @@ func (client RpcClient) SupportedModules() (map[string]string, error) { func (client RpcClient) BatchCall(batch []BatchElem) error { var rpcBatch []rpc.BatchElem - for index, batchElem := range batch { - rpcBatch[index].Result = batchElem.Result - rpcBatch[index].Method = batchElem.Method - rpcBatch[index].Args = batchElem.Args - rpcBatch[index].Error = batchElem.Error + for _, batchElem := range batch { + var newBatchElem = rpc.BatchElem{ + Result: batchElem.Result, + Method: batchElem.Method, + Args: batchElem.Args, + Error: batchElem.Error, + } + + rpcBatch = append(rpcBatch, newBatchElem) } return client.client.BatchCall(rpcBatch) }