@@ -119,25 +119,22 @@ func (m *Miner) SetGasPrice(price *big.Int) {
119
119
120
120
func (self * Miner ) Start (coinbase common.Address , threads int ) {
121
121
atomic .StoreInt32 (& self .shouldStart , 1 )
122
- self .threads = threads
123
- self .worker .coinbase = coinbase
122
+ self .worker .setEtherbase (coinbase )
124
123
self .coinbase = coinbase
124
+ self .threads = threads
125
125
126
126
if atomic .LoadInt32 (& self .canStart ) == 0 {
127
127
glog .V (logger .Info ).Infoln ("Can not start mining operation due to network sync (starts when finished)" )
128
128
return
129
129
}
130
-
131
130
atomic .StoreInt32 (& self .mining , 1 )
132
131
133
132
for i := 0 ; i < threads ; i ++ {
134
133
self .worker .register (NewCpuAgent (i , self .pow ))
135
134
}
136
135
137
136
glog .V (logger .Info ).Infof ("Starting mining operation (CPU=%d TOT=%d)\n " , threads , len (self .worker .agents ))
138
-
139
137
self .worker .start ()
140
-
141
138
self .worker .commitNewWork ()
142
139
}
143
140
@@ -177,8 +174,7 @@ func (self *Miner) SetExtra(extra []byte) error {
177
174
if uint64 (len (extra )) > params .MaximumExtraDataSize .Uint64 () {
178
175
return fmt .Errorf ("Extra exceeds max length. %d > %v" , len (extra ), params .MaximumExtraDataSize )
179
176
}
180
-
181
- self .worker .extra = extra
177
+ self .worker .setExtra (extra )
182
178
return nil
183
179
}
184
180
@@ -188,9 +184,9 @@ func (self *Miner) Pending() (*types.Block, *state.StateDB) {
188
184
}
189
185
190
186
// PendingBlock returns the currently pending block.
191
- //
192
- // Note, to access both the pending block and the pending state
193
- // simultaneously, please use Pending(), as the pending state can
187
+ //
188
+ // Note, to access both the pending block and the pending state
189
+ // simultaneously, please use Pending(), as the pending state can
194
190
// change between multiple method calls
195
191
func (self * Miner ) PendingBlock () * types.Block {
196
192
return self .worker .pendingBlock ()
0 commit comments