@@ -159,8 +159,8 @@ done:
159159
160160 txGas .Sub (txGas , st .gas )
161161 cumulative := new (big.Int ).Set (totalUsedGas .Add (totalUsedGas , txGas ))
162- bloom := ethutil .LeftPadBytes ( LogsBloom ( state .Logs ()). Bytes (), 64 )
163- receipt := & Receipt { ethutil . CopyBytes ( state . Root ()), cumulative , bloom , state . Logs ()}
162+ receipt := & Receipt { ethutil .CopyBytes ( state .Root ()), cumulative , nil /*bloom*/ , state . Logs ()}
163+ receipt . Bloom = CreateBloom ( Receipts { receipt })
164164
165165 // Notify all subscribers
166166 go self .eth .EventMux ().Post (TxPostEvent {tx })
@@ -217,38 +217,38 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
217217
218218 txSha := DeriveSha (block .transactions )
219219 if bytes .Compare (txSha , block .TxSha ) != 0 {
220- err = fmt .Errorf ("Error validating transaction root. Received %x, got %x" , block .TxSha , txSha )
220+ err = fmt .Errorf ("validating transaction root. received=%x got= %x" , block .TxSha , txSha )
221221 return
222222 }
223223
224224 receiptSha := DeriveSha (receipts )
225225 if bytes .Compare (receiptSha , block .ReceiptSha ) != 0 {
226- err = fmt .Errorf ("Error validating receipt root. Received %x, got %x" , block .ReceiptSha , receiptSha )
226+ err = fmt .Errorf ("validating receipt root. received=%x got= %x" , block .ReceiptSha , receiptSha )
227227 return
228228 }
229229
230230 // Block validation
231231 if err = sm .ValidateBlock (block , parent ); err != nil {
232- statelogger .Errorln ("Error validating block:" , err )
232+ statelogger .Errorln ("validating block:" , err )
233233 return
234234 }
235235
236236 if err = sm .AccumelateRewards (state , block , parent ); err != nil {
237- statelogger .Errorln ("Error accumulating reward" , err )
237+ statelogger .Errorln ("accumulating reward" , err )
238238 return
239239 }
240240
241- block .receipts = receipts
242- rbloom := CreateBloom (block )
241+ block .receipts = receipts // although this isn't necessary it be in the future
242+ rbloom := CreateBloom (receipts )
243243 if bytes .Compare (rbloom , block .LogsBloom ) != 0 {
244- err = fmt .Errorf ("unable to replicate block's bloom: %x" , rbloom )
244+ err = fmt .Errorf ("unable to replicate block's bloom= %x" , rbloom )
245245 return
246246 }
247247
248248 state .Update ()
249249
250250 if ! block .State ().Cmp (state ) {
251- err = fmt .Errorf ("Invalid merkle root.\n rec: %x \n is: %x" , block . State () .Root (), state .Root ())
251+ err = fmt .Errorf ("invalid merkle root. received=%x got= %x" , block .Root (), state .Root ())
252252 return
253253 }
254254
0 commit comments