mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
fix
This commit is contained in:
parent
3657810695
commit
b8d64aa30a
2 changed files with 3 additions and 19 deletions
|
|
@ -31,8 +31,6 @@ var (
|
|||
bodyReqTimer = metrics.NewRegisteredTimer("eth/downloader/bodies/req", nil)
|
||||
bodyDropMeter = metrics.NewRegisteredMeter("eth/downloader/bodies/drop", nil)
|
||||
bodyTimeoutMeter = metrics.NewRegisteredMeter("eth/downloader/bodies/timeout", nil)
|
||||
|
||||
blockSizeGauge = metrics.NewRegisteredGauge("eth/downloader/blocks/size", nil)
|
||||
pendingBodyGauge = metrics.NewRegisteredGauge("eth/downloader/bodies/pending", nil)
|
||||
|
||||
receiptInMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/in", nil)
|
||||
|
|
|
|||
|
|
@ -22,11 +22,6 @@ package downloader
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/prque"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
|
@ -35,6 +30,9 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -89,18 +87,6 @@ func newFetchResult(header *types.Header, snapSync bool) *fetchResult {
|
|||
return item
|
||||
}
|
||||
|
||||
func (f *fetchResult) Size() int {
|
||||
receiptsSize := 0
|
||||
for _, r := range f.Receipts {
|
||||
receiptsSize += int(r.Size())
|
||||
}
|
||||
txsSize := 0
|
||||
for _, t := range f.Transactions {
|
||||
txsSize += int(t.Size())
|
||||
}
|
||||
return common.HashLength*len(f.Uncles) + int(unsafe.Sizeof(types.Withdrawal{})) + int(f.Header.Size()) + receiptsSize + txsSize
|
||||
}
|
||||
|
||||
// body returns a representation of the fetch result as a types.Body object.
|
||||
func (f *fetchResult) body() types.Body {
|
||||
return types.Body{
|
||||
|
|
|
|||
Loading…
Reference in a new issue