From bfdc0fa3622d7c3b421d2f5a6dda5746be41bfde Mon Sep 17 00:00:00 2001 From: Eugene Valeyev Date: Mon, 6 Nov 2017 18:46:43 +0300 Subject: mobile: fix FilterLogs (#15418) All logs in the FilterLog return value would be the same object because the for loop captured the pointer to the iteration variable. --- mobile/ethclient.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mobile') diff --git a/mobile/ethclient.go b/mobile/ethclient.go index 7f31a8998..758863b6d 100644 --- a/mobile/ethclient.go +++ b/mobile/ethclient.go @@ -198,8 +198,8 @@ func (ec *EthereumClient) FilterLogs(ctx *Context, query *FilterQuery) (logs *Lo } // Temp hack due to vm.Logs being []*vm.Log res := make([]*types.Log, len(rawLogs)) - for i, log := range rawLogs { - res[i] = &log + for i := range rawLogs { + res[i] = &rawLogs[i] } return &Logs{res}, nil } -- cgit v1.2.3