@@ -21,7 +21,7 @@ type StateReleaseFunc tracers.StateReleaseFunc
21
21
22
22
var NoopStateRelease StateReleaseFunc = func () {}
23
23
24
- type StateBuildingLogFunction func (targetHeader , header * types.Header , hasState bool )
24
+ type StateBuildingLogFunction func (header * types.Header , hasState bool )
25
25
type StateForHeaderFunction func (header * types.Header ) (* state.StateDB , StateReleaseFunc , error )
26
26
27
27
// finds last available state and header checking it first for targetHeader then looking backwards
@@ -56,7 +56,7 @@ func FindLastAvailableState(ctx context.Context, bc *core.BlockChain, stateFor S
56
56
return nil , lastHeader , nil , err
57
57
}
58
58
if logFunc != nil {
59
- logFunc (targetHeader , currentHeader , false )
59
+ logFunc (currentHeader , false )
60
60
}
61
61
if currentHeader .Number .Uint64 () <= genesis {
62
62
return nil , lastHeader , nil , errors .Wrap (err , fmt .Sprintf ("moved beyond genesis looking for state %d, genesis %d" , targetHeader .Number .Uint64 (), genesis ))
@@ -69,7 +69,7 @@ func FindLastAvailableState(ctx context.Context, bc *core.BlockChain, stateFor S
69
69
return state , currentHeader , release , ctx .Err ()
70
70
}
71
71
72
- func AdvanceStateByBlock (ctx context.Context , bc * core.BlockChain , state * state.StateDB , targetHeader * types. Header , blockToRecreate uint64 , prevBlockHash common.Hash , logFunc StateBuildingLogFunction ) (* state.StateDB , * types.Block , error ) {
72
+ func AdvanceStateByBlock (ctx context.Context , bc * core.BlockChain , state * state.StateDB , blockToRecreate uint64 , prevBlockHash common.Hash , logFunc StateBuildingLogFunction ) (* state.StateDB , * types.Block , error ) {
73
73
block := bc .GetBlockByNumber (blockToRecreate )
74
74
if block == nil {
75
75
return nil , nil , fmt .Errorf ("block not found while recreating: %d" , blockToRecreate )
@@ -78,7 +78,7 @@ func AdvanceStateByBlock(ctx context.Context, bc *core.BlockChain, state *state.
78
78
return nil , nil , fmt .Errorf ("reorg detected: number %d expectedPrev: %v foundPrev: %v" , blockToRecreate , prevBlockHash , block .ParentHash ())
79
79
}
80
80
if logFunc != nil {
81
- logFunc (targetHeader , block .Header (), true )
81
+ logFunc (block .Header (), true )
82
82
}
83
83
_ , _ , _ , err := bc .Processor ().Process (block , state , vm.Config {})
84
84
if err != nil {
0 commit comments