(tx *types.Transaction, bc *core.BlockChain, coinbase common.Address, gp *core.GasPool)
| 574 | } |
| 575 | |
| 576 | func (w *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, coinbase common.Address, gp *core.GasPool) (error, []*types.Log) { |
| 577 | snap := w.pubState.Snapshot() |
| 578 | snapPriv := w.privState.Snapshot() |
| 579 | |
| 580 | pubReceipt, privReceipt, _, err := core.ApplyTransaction(w.config, bc, &coinbase, gp, w.pubState, w.privState, w.remoteDB, |
| 581 | w.header, tx, &w.header.GasUsed, vm.Config{}, w.accm) |
| 582 | if err != nil { |
| 583 | w.pubState.RevertToSnapshot(snap) |
| 584 | w.privState.RevertToSnapshot(snapPriv) |
| 585 | return err, nil |
| 586 | } |
| 587 | w.txs = append(w.txs, tx) |
| 588 | w.pubReceipts = append(w.pubReceipts, pubReceipt) |
| 589 | if privReceipt != nil { |
| 590 | w.privReceipts = append(w.privReceipts, privReceipt) |
| 591 | } |
| 592 | |
| 593 | // TODO: consider whether append private logs to returned logs together. |
| 594 | return nil, pubReceipt.Logs |
| 595 | } |
no test coverage detected