mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-15 16:33:47 +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() {
|
for i, tx := range block.Transactions() {
|
||||||
evmTrace := blockResult.ExecutionResults[i]
|
evmTrace := blockResult.ExecutionResults[i]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlockTrace struct {
|
type BlockTrace struct {
|
||||||
Number *big.Int `json:"number"`
|
Number *big.Int `json:"number"`
|
||||||
Hash common.Hash `json:"hash"`
|
Hash common.Hash `json:"hash"`
|
||||||
GasLimit uint64 `json:"gasLimit"`
|
GasLimit uint64 `json:"gasLimit"`
|
||||||
Difficulty *big.Int `json:"difficulty"`
|
Difficulty *big.Int `json:"difficulty"`
|
||||||
BaseFee *big.Int `json:"baseFee"`
|
BaseFee *big.Int `json:"baseFee"`
|
||||||
Coinbase AccountProofWrapper `json:"coinbase"`
|
Coinbase *AccountProofWrapper `json:"coinbase"`
|
||||||
Time uint64 `json:"time"`
|
Time uint64 `json:"time"`
|
||||||
Transactions []*TransactionTrace `json:"transactions"`
|
Transactions []*TransactionTrace `json:"transactions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TransactionTrace struct {
|
type TransactionTrace struct {
|
||||||
|
|
@ -36,7 +36,7 @@ type TransactionTrace struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTraceBlock supports necessary fields for roller.
|
// 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())
|
txs := make([]*TransactionTrace, block.Transactions().Len())
|
||||||
for i, tx := range block.Transactions() {
|
for i, tx := range block.Transactions() {
|
||||||
txs[i] = newTraceTransaction(tx, block.NumberU64(), config)
|
txs[i] = newTraceTransaction(tx, block.NumberU64(), config)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue