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.
pull/15441/head
Eugene Valeyev 7 years ago committed by Felix Lange
parent 9f7cd75682
commit bfdc0fa362
  1. 4
      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 // Temp hack due to vm.Logs being []*vm.Log
res := make([]*types.Log, len(rawLogs)) res := make([]*types.Log, len(rawLogs))
for i, log := range rawLogs { for i := range rawLogs {
res[i] = &log res[i] = &rawLogs[i]
} }
return &Logs{res}, nil return &Logs{res}, nil
} }

Loading…
Cancel
Save