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.
This commit is contained in:
Eugene Valeyev 2017-11-06 18:46:43 +03:00 committed by Felix Lange
parent 9f7cd75682
commit bfdc0fa362
1 changed files with 2 additions and 2 deletions

View File

@ -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
}