File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ type StateDB struct {
44
44
thash , bhash common.Hash
45
45
txIndex int
46
46
logs map [common.Hash ]Logs
47
+ logSize uint
47
48
}
48
49
49
50
// Create a new state from a given trie
@@ -66,7 +67,9 @@ func (self *StateDB) AddLog(log *Log) {
66
67
log .TxHash = self .thash
67
68
log .BlockHash = self .bhash
68
69
log .TxIndex = uint (self .txIndex )
70
+ log .Index = self .logSize
69
71
self .logs [self .thash ] = append (self .logs [self .thash ], log )
72
+ self .logSize ++
70
73
}
71
74
72
75
func (self * StateDB ) GetLogs (hash common.Hash ) Logs {
@@ -288,6 +291,7 @@ func (self *StateDB) Copy() *StateDB {
288
291
state .logs [hash ] = make (Logs , len (logs ))
289
292
copy (state .logs [hash ], logs )
290
293
}
294
+ state .logSize = self .logSize
291
295
292
296
return state
293
297
}
@@ -298,6 +302,7 @@ func (self *StateDB) Set(state *StateDB) {
298
302
299
303
self .refund = state .refund
300
304
self .logs = state .logs
305
+ self .logSize = state .logSize
301
306
}
302
307
303
308
func (s * StateDB ) Root () common.Hash {
You can’t perform that action at this time.
0 commit comments