mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-05 03:23:46 +00:00
optimizate code (#63)
This commit is contained in:
parent
360115e61f
commit
e55d05d3ab
2 changed files with 10 additions and 10 deletions
|
|
@ -1363,7 +1363,7 @@ func (bc *BlockChain) writeBlockResult(state *state.StateDB, block *types.Block,
|
|||
}
|
||||
}
|
||||
|
||||
blockResult.BlockTrace = types.NewTraceBlock(bc.chainConfig, block, coinbase)
|
||||
blockResult.BlockTrace = types.NewTraceBlock(bc.chainConfig, block, &coinbase)
|
||||
for i, tx := range block.Transactions() {
|
||||
evmTrace := blockResult.ExecutionResults[i]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import (
|
|||
)
|
||||
|
||||
type BlockTrace struct {
|
||||
Number *big.Int `json:"number"`
|
||||
Hash common.Hash `json:"hash"`
|
||||
GasLimit uint64 `json:"gasLimit"`
|
||||
Difficulty *big.Int `json:"difficulty"`
|
||||
BaseFee *big.Int `json:"baseFee"`
|
||||
Coinbase AccountProofWrapper `json:"coinbase"`
|
||||
Time uint64 `json:"time"`
|
||||
Transactions []*TransactionTrace `json:"transactions"`
|
||||
Number *big.Int `json:"number"`
|
||||
Hash common.Hash `json:"hash"`
|
||||
GasLimit uint64 `json:"gasLimit"`
|
||||
Difficulty *big.Int `json:"difficulty"`
|
||||
BaseFee *big.Int `json:"baseFee"`
|
||||
Coinbase *AccountProofWrapper `json:"coinbase"`
|
||||
Time uint64 `json:"time"`
|
||||
Transactions []*TransactionTrace `json:"transactions"`
|
||||
}
|
||||
|
||||
type TransactionTrace struct {
|
||||
|
|
@ -36,7 +36,7 @@ type TransactionTrace struct {
|
|||
}
|
||||
|
||||
// NewTraceBlock supports necessary fields for roller.
|
||||
func NewTraceBlock(config *params.ChainConfig, block *Block, coinbase AccountProofWrapper) *BlockTrace {
|
||||
func NewTraceBlock(config *params.ChainConfig, block *Block, coinbase *AccountProofWrapper) *BlockTrace {
|
||||
txs := make([]*TransactionTrace, block.Transactions().Len())
|
||||
for i, tx := range block.Transactions() {
|
||||
txs[i] = newTraceTransaction(tx, block.NumberU64(), config)
|
||||
|
|
|
|||
Loading…
Reference in a new issue