Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
7aad81f8
Commit
7aad81f8
authored
Apr 04, 2018
by
Yusup
Committed by
Felix Lange
Apr 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: fix typos (#16414)
parent
2a4bd55b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
29 deletions
+29
-29
backend.go
eth/backend.go
+2
-2
db_upgrade.go
eth/db_upgrade.go
+2
-2
downloader.go
eth/downloader/downloader.go
+4
-4
downloader_test.go
eth/downloader/downloader_test.go
+1
-1
fakepeer.go
eth/downloader/fakepeer.go
+3
-3
peer.go
eth/downloader/peer.go
+1
-1
queue.go
eth/downloader/queue.go
+1
-1
statesync.go
eth/downloader/statesync.go
+5
-5
fetcher.go
eth/fetcher/fetcher.go
+1
-1
api.go
eth/filters/api.go
+1
-1
handler.go
eth/handler.go
+8
-8
No files found.
eth/backend.go
View file @
7aad81f8
...
@@ -63,7 +63,7 @@ type Ethereum struct {
...
@@ -63,7 +63,7 @@ type Ethereum struct {
chainConfig
*
params
.
ChainConfig
chainConfig
*
params
.
ChainConfig
// Channel for shutting down the service
// Channel for shutting down the service
shutdownChan
chan
bool
// Channel for shutting down the
e
thereum
shutdownChan
chan
bool
// Channel for shutting down the
E
thereum
stopDbUpgrade
func
()
error
// stop chain db sequential key upgrade
stopDbUpgrade
func
()
error
// stop chain db sequential key upgrade
// Handlers
// Handlers
...
@@ -351,7 +351,7 @@ func (s *Ethereum) StartMining(local bool) error {
...
@@ -351,7 +351,7 @@ func (s *Ethereum) StartMining(local bool) error {
if
local
{
if
local
{
// If local (CPU) mining is started, we can disable the transaction rejection
// If local (CPU) mining is started, we can disable the transaction rejection
// mechanism introduced to speed sync times. CPU mining on mainnet is ludicrous
// mechanism introduced to speed sync times. CPU mining on mainnet is ludicrous
// so no
o
ne will ever hit this path, whereas marking sync done on CPU mining
// so none will ever hit this path, whereas marking sync done on CPU mining
// will ensure that private networks work in single miner mode too.
// will ensure that private networks work in single miner mode too.
atomic
.
StoreUint32
(
&
s
.
protocolManager
.
acceptTxs
,
1
)
atomic
.
StoreUint32
(
&
s
.
protocolManager
.
acceptTxs
,
1
)
}
}
...
...
eth/db_upgrade.go
View file @
7aad81f8
...
@@ -62,7 +62,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
...
@@ -62,7 +62,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
failed
error
failed
error
)
)
for
failed
==
nil
&&
it
.
Next
()
{
for
failed
==
nil
&&
it
.
Next
()
{
// Skip any entries that don't look like old transaction meta ent
ir
es (<hash>0x01)
// Skip any entries that don't look like old transaction meta ent
ri
es (<hash>0x01)
key
:=
it
.
Key
()
key
:=
it
.
Key
()
if
len
(
key
)
!=
common
.
HashLength
+
1
||
key
[
common
.
HashLength
]
!=
0x01
{
if
len
(
key
)
!=
common
.
HashLength
+
1
||
key
[
common
.
HashLength
]
!=
0x01
{
continue
continue
...
@@ -86,7 +86,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
...
@@ -86,7 +86,7 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
}
}
}
}
// Convert the old metadata to a new lookup entry, delete duplicate data
// Convert the old metadata to a new lookup entry, delete duplicate data
if
failed
=
db
.
Put
(
append
([]
byte
(
"l"
),
hash
...
),
it
.
Value
());
failed
==
nil
{
// Write the new looku entry
if
failed
=
db
.
Put
(
append
([]
byte
(
"l"
),
hash
...
),
it
.
Value
());
failed
==
nil
{
// Write the new looku
p
entry
if
failed
=
db
.
Delete
(
hash
);
failed
==
nil
{
// Delete the duplicate transaction data
if
failed
=
db
.
Delete
(
hash
);
failed
==
nil
{
// Delete the duplicate transaction data
if
failed
=
db
.
Delete
(
append
([]
byte
(
"receipts-"
),
hash
...
));
failed
==
nil
{
// Delete the duplicate receipt data
if
failed
=
db
.
Delete
(
append
([]
byte
(
"receipts-"
),
hash
...
));
failed
==
nil
{
// Delete the duplicate receipt data
if
failed
=
db
.
Delete
(
key
);
failed
!=
nil
{
// Delete the old transaction metadata
if
failed
=
db
.
Delete
(
key
);
failed
!=
nil
{
// Delete the old transaction metadata
...
...
eth/downloader/downloader.go
View file @
7aad81f8
...
@@ -47,7 +47,7 @@ var (
...
@@ -47,7 +47,7 @@ var (
MaxForkAncestry
=
3
*
params
.
EpochDuration
// Maximum chain reorganisation
MaxForkAncestry
=
3
*
params
.
EpochDuration
// Maximum chain reorganisation
rttMinEstimate
=
2
*
time
.
Second
// Minimum round-trip time to target for download requests
rttMinEstimate
=
2
*
time
.
Second
// Minimum round-trip time to target for download requests
rttMaxEstimate
=
20
*
time
.
Second
// Maximum roun
t
-trip time to target for download requests
rttMaxEstimate
=
20
*
time
.
Second
// Maximum roun
d
-trip time to target for download requests
rttMinConfidence
=
0.1
// Worse confidence factor in our estimated RTT value
rttMinConfidence
=
0.1
// Worse confidence factor in our estimated RTT value
ttlScaling
=
3
// Constant scaling factor for RTT -> TTL conversion
ttlScaling
=
3
// Constant scaling factor for RTT -> TTL conversion
ttlLimit
=
time
.
Minute
// Maximum TTL allowance to prevent reaching crazy timeouts
ttlLimit
=
time
.
Minute
// Maximum TTL allowance to prevent reaching crazy timeouts
...
@@ -884,7 +884,7 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64, pivot uint64)
...
@@ -884,7 +884,7 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64, pivot uint64)
// immediately to the header processor to keep the rest of the pipeline full even
// immediately to the header processor to keep the rest of the pipeline full even
// in the case of header stalls.
// in the case of header stalls.
//
//
// The method returs the entire filled skeleton and also the number of headers
// The method retur
n
s the entire filled skeleton and also the number of headers
// already forwarded for processing.
// already forwarded for processing.
func
(
d
*
Downloader
)
fillHeaderSkeleton
(
from
uint64
,
skeleton
[]
*
types
.
Header
)
([]
*
types
.
Header
,
int
,
error
)
{
func
(
d
*
Downloader
)
fillHeaderSkeleton
(
from
uint64
,
skeleton
[]
*
types
.
Header
)
([]
*
types
.
Header
,
int
,
error
)
{
log
.
Debug
(
"Filling up skeleton"
,
"from"
,
from
)
log
.
Debug
(
"Filling up skeleton"
,
"from"
,
from
)
...
@@ -1377,7 +1377,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
...
@@ -1377,7 +1377,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
pivot
=
height
-
uint64
(
fsMinFullBlocks
)
pivot
=
height
-
uint64
(
fsMinFullBlocks
)
}
}
// To cater for moving pivot points, track the pivot block and subsequently
// To cater for moving pivot points, track the pivot block and subsequently
// accumulated download results separatey.
// accumulated download results separate
l
y.
var
(
var
(
oldPivot
*
fetchResult
// Locked in pivot block, might change eventually
oldPivot
*
fetchResult
// Locked in pivot block, might change eventually
oldTail
[]
*
fetchResult
// Downloaded content after the pivot
oldTail
[]
*
fetchResult
// Downloaded content after the pivot
...
@@ -1615,7 +1615,7 @@ func (d *Downloader) qosReduceConfidence() {
...
@@ -1615,7 +1615,7 @@ func (d *Downloader) qosReduceConfidence() {
//
//
// Note, the returned RTT is .9 of the actually estimated RTT. The reason is that
// Note, the returned RTT is .9 of the actually estimated RTT. The reason is that
// the downloader tries to adapt queries to the RTT, so multiple RTT values can
// the downloader tries to adapt queries to the RTT, so multiple RTT values can
// be adapted to, but smaller ones are pref
fe
red (stabler download stream).
// be adapted to, but smaller ones are pref
er
red (stabler download stream).
func
(
d
*
Downloader
)
requestRTT
()
time
.
Duration
{
func
(
d
*
Downloader
)
requestRTT
()
time
.
Duration
{
return
time
.
Duration
(
atomic
.
LoadUint64
(
&
d
.
rttEstimate
))
*
9
/
10
return
time
.
Duration
(
atomic
.
LoadUint64
(
&
d
.
rttEstimate
))
*
9
/
10
}
}
...
...
eth/downloader/downloader_test.go
View file @
7aad81f8
...
@@ -159,7 +159,7 @@ func (dl *downloadTester) makeChainFork(n, f int, parent *types.Block, parentRec
...
@@ -159,7 +159,7 @@ func (dl *downloadTester) makeChainFork(n, f int, parent *types.Block, parentRec
// Create the common suffix
// Create the common suffix
hashes
,
headers
,
blocks
,
receipts
:=
dl
.
makeChain
(
n
-
f
,
0
,
parent
,
parentReceipts
,
false
)
hashes
,
headers
,
blocks
,
receipts
:=
dl
.
makeChain
(
n
-
f
,
0
,
parent
,
parentReceipts
,
false
)
// Create the forks, making the second heav
y
er if non balanced forks were requested
// Create the forks, making the second heav
i
er if non balanced forks were requested
hashes1
,
headers1
,
blocks1
,
receipts1
:=
dl
.
makeChain
(
f
,
1
,
blocks
[
hashes
[
0
]],
receipts
[
hashes
[
0
]],
false
)
hashes1
,
headers1
,
blocks1
,
receipts1
:=
dl
.
makeChain
(
f
,
1
,
blocks
[
hashes
[
0
]],
receipts
[
hashes
[
0
]],
false
)
hashes1
=
append
(
hashes1
,
hashes
[
1
:
]
...
)
hashes1
=
append
(
hashes1
,
hashes
[
1
:
]
...
)
...
...
eth/downloader/fakepeer.go
View file @
7aad81f8
...
@@ -27,7 +27,7 @@ import (
...
@@ -27,7 +27,7 @@ import (
// FakePeer is a mock downloader peer that operates on a local database instance
// FakePeer is a mock downloader peer that operates on a local database instance
// instead of being an actual live node. It's useful for testing and to implement
// instead of being an actual live node. It's useful for testing and to implement
// sync commands from an xisting local database.
// sync commands from an
e
xisting local database.
type
FakePeer
struct
{
type
FakePeer
struct
{
id
string
id
string
db
ethdb
.
Database
db
ethdb
.
Database
...
@@ -48,7 +48,7 @@ func (p *FakePeer) Head() (common.Hash, *big.Int) {
...
@@ -48,7 +48,7 @@ func (p *FakePeer) Head() (common.Hash, *big.Int) {
}
}
// RequestHeadersByHash implements downloader.Peer, returning a batch of headers
// RequestHeadersByHash implements downloader.Peer, returning a batch of headers
// defined by the origin hash and the associaed query parameters.
// defined by the origin hash and the associa
t
ed query parameters.
func
(
p
*
FakePeer
)
RequestHeadersByHash
(
hash
common
.
Hash
,
amount
int
,
skip
int
,
reverse
bool
)
error
{
func
(
p
*
FakePeer
)
RequestHeadersByHash
(
hash
common
.
Hash
,
amount
int
,
skip
int
,
reverse
bool
)
error
{
var
(
var
(
headers
[]
*
types
.
Header
headers
[]
*
types
.
Header
...
@@ -92,7 +92,7 @@ func (p *FakePeer) RequestHeadersByHash(hash common.Hash, amount int, skip int,
...
@@ -92,7 +92,7 @@ func (p *FakePeer) RequestHeadersByHash(hash common.Hash, amount int, skip int,
}
}
// RequestHeadersByNumber implements downloader.Peer, returning a batch of headers
// RequestHeadersByNumber implements downloader.Peer, returning a batch of headers
// defined by the origin number and the associaed query parameters.
// defined by the origin number and the associa
t
ed query parameters.
func
(
p
*
FakePeer
)
RequestHeadersByNumber
(
number
uint64
,
amount
int
,
skip
int
,
reverse
bool
)
error
{
func
(
p
*
FakePeer
)
RequestHeadersByNumber
(
number
uint64
,
amount
int
,
skip
int
,
reverse
bool
)
error
{
var
(
var
(
headers
[]
*
types
.
Header
headers
[]
*
types
.
Header
...
...
eth/downloader/peer.go
View file @
7aad81f8
...
@@ -551,7 +551,7 @@ func (ps *peerSet) idlePeers(minProtocol, maxProtocol int, idleCheck func(*peerC
...
@@ -551,7 +551,7 @@ func (ps *peerSet) idlePeers(minProtocol, maxProtocol int, idleCheck func(*peerC
// medianRTT returns the median RTT of the peerset, considering only the tuning
// medianRTT returns the median RTT of the peerset, considering only the tuning
// peers if there are more peers available.
// peers if there are more peers available.
func
(
ps
*
peerSet
)
medianRTT
()
time
.
Duration
{
func
(
ps
*
peerSet
)
medianRTT
()
time
.
Duration
{
// Gather all the curr
ne
tly measured round trip times
// Gather all the curr
en
tly measured round trip times
ps
.
lock
.
RLock
()
ps
.
lock
.
RLock
()
defer
ps
.
lock
.
RUnlock
()
defer
ps
.
lock
.
RUnlock
()
...
...
eth/downloader/queue.go
View file @
7aad81f8
...
@@ -275,7 +275,7 @@ func (q *queue) ScheduleSkeleton(from uint64, skeleton []*types.Header) {
...
@@ -275,7 +275,7 @@ func (q *queue) ScheduleSkeleton(from uint64, skeleton []*types.Header) {
if
q
.
headerResults
!=
nil
{
if
q
.
headerResults
!=
nil
{
panic
(
"skeleton assembly already in progress"
)
panic
(
"skeleton assembly already in progress"
)
}
}
// Shedule all the header retrieval tasks for the skeleton assembly
// S
c
hedule all the header retrieval tasks for the skeleton assembly
q
.
headerTaskPool
=
make
(
map
[
uint64
]
*
types
.
Header
)
q
.
headerTaskPool
=
make
(
map
[
uint64
]
*
types
.
Header
)
q
.
headerTaskQueue
=
prque
.
New
()
q
.
headerTaskQueue
=
prque
.
New
()
q
.
headerPeerMiss
=
make
(
map
[
string
]
map
[
uint64
]
struct
{})
// Reset availability to correct invalid chains
q
.
headerPeerMiss
=
make
(
map
[
string
]
map
[
uint64
]
struct
{})
// Reset availability to correct invalid chains
...
...
eth/downloader/statesync.go
View file @
7aad81f8
...
@@ -31,7 +31,7 @@ import (
...
@@ -31,7 +31,7 @@ import (
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/trie"
)
)
// stateReq represents a batch of state fetch requests group
p
ed together into
// stateReq represents a batch of state fetch requests grouped together into
// a single data retrieval network packet.
// a single data retrieval network packet.
type
stateReq
struct
{
type
stateReq
struct
{
items
[]
common
.
Hash
// Hashes of the state items to download
items
[]
common
.
Hash
// Hashes of the state items to download
...
@@ -139,7 +139,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
...
@@ -139,7 +139,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
// Handle incoming state packs:
// Handle incoming state packs:
case
pack
:=
<-
d
.
stateCh
:
case
pack
:=
<-
d
.
stateCh
:
// Discard any data not requested (or previ
sou
ly timed out)
// Discard any data not requested (or previ
ous
ly timed out)
req
:=
active
[
pack
.
PeerId
()]
req
:=
active
[
pack
.
PeerId
()]
if
req
==
nil
{
if
req
==
nil
{
log
.
Debug
(
"Unrequested node data"
,
"peer"
,
pack
.
PeerId
(),
"len"
,
pack
.
Items
())
log
.
Debug
(
"Unrequested node data"
,
"peer"
,
pack
.
PeerId
(),
"len"
,
pack
.
Items
())
...
@@ -182,7 +182,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
...
@@ -182,7 +182,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
case
req
:=
<-
d
.
trackStateReq
:
case
req
:=
<-
d
.
trackStateReq
:
// If an active request already exists for this peer, we have a problem. In
// If an active request already exists for this peer, we have a problem. In
// theory the trie node schedule must never assign two requests to the same
// theory the trie node schedule must never assign two requests to the same
// peer. In practi
v
e however, a peer might receive a request, disconnect and
// peer. In practi
c
e however, a peer might receive a request, disconnect and
// immediately reconnect before the previous times out. In this case the first
// immediately reconnect before the previous times out. In this case the first
// request is never honored, alas we must not silently overwrite it, as that
// request is never honored, alas we must not silently overwrite it, as that
// causes valid requests to go missing and sync to get stuck.
// causes valid requests to go missing and sync to get stuck.
...
@@ -228,7 +228,7 @@ type stateSync struct {
...
@@ -228,7 +228,7 @@ type stateSync struct {
err
error
// Any error hit during sync (set before completion)
err
error
// Any error hit during sync (set before completion)
}
}
// stateTask represents a single trie node download ta
ks
, containing a set of
// stateTask represents a single trie node download ta
sk
, containing a set of
// peers already attempted retrieval from to detect stalled syncs and abort.
// peers already attempted retrieval from to detect stalled syncs and abort.
type
stateTask
struct
{
type
stateTask
struct
{
attempts
map
[
string
]
struct
{}
attempts
map
[
string
]
struct
{}
...
@@ -333,7 +333,7 @@ func (s *stateSync) commit(force bool) error {
...
@@ -333,7 +333,7 @@ func (s *stateSync) commit(force bool) error {
return
nil
return
nil
}
}
// assignTasks attempts to assi
ng
new tasks to all idle peers, either from the
// assignTasks attempts to assi
gn
new tasks to all idle peers, either from the
// batch currently being retried, or fetching new data from the trie sync itself.
// batch currently being retried, or fetching new data from the trie sync itself.
func
(
s
*
stateSync
)
assignTasks
()
{
func
(
s
*
stateSync
)
assignTasks
()
{
// Iterate over all idle peers and try to assign them state fetches
// Iterate over all idle peers and try to assign them state fetches
...
...
eth/fetcher/fetcher.go
View file @
7aad81f8
...
@@ -127,7 +127,7 @@ type Fetcher struct {
...
@@ -127,7 +127,7 @@ type Fetcher struct {
// Block cache
// Block cache
queue
*
prque
.
Prque
// Queue containing the import operations (block number sorted)
queue
*
prque
.
Prque
// Queue containing the import operations (block number sorted)
queues
map
[
string
]
int
// Per peer block counts to prevent memory exhaustion
queues
map
[
string
]
int
// Per peer block counts to prevent memory exhaustion
queued
map
[
common
.
Hash
]
*
inject
// Set of already queued blocks (to dedup imports)
queued
map
[
common
.
Hash
]
*
inject
// Set of already queued blocks (to dedup
e
imports)
// Callbacks
// Callbacks
getBlock
blockRetrievalFn
// Retrieves a block from the local chain
getBlock
blockRetrievalFn
// Retrieves a block from the local chain
...
...
eth/filters/api.go
View file @
7aad81f8
...
@@ -98,7 +98,7 @@ func (api *PublicFilterAPI) timeoutLoop() {
...
@@ -98,7 +98,7 @@ func (api *PublicFilterAPI) timeoutLoop() {
// NewPendingTransactionFilter creates a filter that fetches pending transaction hashes
// NewPendingTransactionFilter creates a filter that fetches pending transaction hashes
// as transactions enter the pending state.
// as transactions enter the pending state.
//
//
// It is part of the filter package because this filter can be used throug the
// It is part of the filter package because this filter can be used throug
h
the
// `eth_getFilterChanges` polling method that is also used for log filters.
// `eth_getFilterChanges` polling method that is also used for log filters.
//
//
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter
...
...
eth/handler.go
View file @
7aad81f8
...
@@ -96,8 +96,8 @@ type ProtocolManager struct {
...
@@ -96,8 +96,8 @@ type ProtocolManager struct {
wg
sync
.
WaitGroup
wg
sync
.
WaitGroup
}
}
// NewProtocolManager returns a new
e
thereum sub protocol manager. The Ethereum sub protocol manages peers capable
// NewProtocolManager returns a new
E
thereum sub protocol manager. The Ethereum sub protocol manages peers capable
// with the
e
thereum network.
// with the
E
thereum network.
func
NewProtocolManager
(
config
*
params
.
ChainConfig
,
mode
downloader
.
SyncMode
,
networkId
uint64
,
mux
*
event
.
TypeMux
,
txpool
txPool
,
engine
consensus
.
Engine
,
blockchain
*
core
.
BlockChain
,
chaindb
ethdb
.
Database
)
(
*
ProtocolManager
,
error
)
{
func
NewProtocolManager
(
config
*
params
.
ChainConfig
,
mode
downloader
.
SyncMode
,
networkId
uint64
,
mux
*
event
.
TypeMux
,
txpool
txPool
,
engine
consensus
.
Engine
,
blockchain
*
core
.
BlockChain
,
chaindb
ethdb
.
Database
)
(
*
ProtocolManager
,
error
)
{
// Create the protocol manager with the base fields
// Create the protocol manager with the base fields
manager
:=
&
ProtocolManager
{
manager
:=
&
ProtocolManager
{
...
@@ -498,20 +498,20 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
...
@@ -498,20 +498,20 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
return
errResp
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
return
errResp
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
}
}
// Deliver them all to the downloader for queuing
// Deliver them all to the downloader for queuing
trasactions
:=
make
([][]
*
types
.
Transaction
,
len
(
request
))
tra
n
sactions
:=
make
([][]
*
types
.
Transaction
,
len
(
request
))
uncles
:=
make
([][]
*
types
.
Header
,
len
(
request
))
uncles
:=
make
([][]
*
types
.
Header
,
len
(
request
))
for
i
,
body
:=
range
request
{
for
i
,
body
:=
range
request
{
trasactions
[
i
]
=
body
.
Transactions
tra
n
sactions
[
i
]
=
body
.
Transactions
uncles
[
i
]
=
body
.
Uncles
uncles
[
i
]
=
body
.
Uncles
}
}
// Filter out any explicitly requested bodies, deliver the rest to the downloader
// Filter out any explicitly requested bodies, deliver the rest to the downloader
filter
:=
len
(
trasactions
)
>
0
||
len
(
uncles
)
>
0
filter
:=
len
(
tra
n
sactions
)
>
0
||
len
(
uncles
)
>
0
if
filter
{
if
filter
{
tra
sactions
,
uncles
=
pm
.
fetcher
.
FilterBodies
(
p
.
id
,
tra
sactions
,
uncles
,
time
.
Now
())
tra
nsactions
,
uncles
=
pm
.
fetcher
.
FilterBodies
(
p
.
id
,
tran
sactions
,
uncles
,
time
.
Now
())
}
}
if
len
(
trasactions
)
>
0
||
len
(
uncles
)
>
0
||
!
filter
{
if
len
(
tra
n
sactions
)
>
0
||
len
(
uncles
)
>
0
||
!
filter
{
err
:=
pm
.
downloader
.
DeliverBodies
(
p
.
id
,
trasactions
,
uncles
)
err
:=
pm
.
downloader
.
DeliverBodies
(
p
.
id
,
tra
n
sactions
,
uncles
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Debug
(
"Failed to deliver bodies"
,
"err"
,
err
)
log
.
Debug
(
"Failed to deliver bodies"
,
"err"
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment