mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +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)
|
bodyReqTimer = metrics.NewRegisteredTimer("eth/downloader/bodies/req", nil)
|
||||||
bodyDropMeter = metrics.NewRegisteredMeter("eth/downloader/bodies/drop", nil)
|
bodyDropMeter = metrics.NewRegisteredMeter("eth/downloader/bodies/drop", nil)
|
||||||
bodyTimeoutMeter = metrics.NewRegisteredMeter("eth/downloader/bodies/timeout", 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)
|
pendingBodyGauge = metrics.NewRegisteredGauge("eth/downloader/bodies/pending", nil)
|
||||||
|
|
||||||
receiptInMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/in", nil)
|
receiptInMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/in", nil)
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,6 @@ package downloader
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
|
||||||
"sync/atomic"
|
|
||||||
"time"
|
|
||||||
"unsafe"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/prque"
|
"github.com/ethereum/go-ethereum/common/prque"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
|
@ -35,6 +30,9 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/metrics"
|
"github.com/ethereum/go-ethereum/metrics"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -89,18 +87,6 @@ func newFetchResult(header *types.Header, snapSync bool) *fetchResult {
|
||||||
return item
|
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.
|
// body returns a representation of the fetch result as a types.Body object.
|
||||||
func (f *fetchResult) body() types.Body {
|
func (f *fetchResult) body() types.Body {
|
||||||
return types.Body{
|
return types.Body{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue