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
49c2816d
Unverified
Commit
49c2816d
authored
Jan 11, 2021
by
Marius van der Wijden
Committed by
GitHub
Jan 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: improve log message (#22146)
* eth: fixed typos * eth: fixed log message
parent
79e2174e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
handler.go
eth/handler.go
+3
-3
peerset.go
eth/peerset.go
+2
-2
No files found.
eth/handler.go
View file @
49c2816d
...
@@ -437,14 +437,14 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool)
...
@@ -437,14 +437,14 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool)
// Broadcast transactions to a batch of peers not knowing about it
// Broadcast transactions to a batch of peers not knowing about it
if
propagate
{
if
propagate
{
for
_
,
tx
:=
range
txs
{
for
_
,
tx
:=
range
txs
{
peers
:=
h
.
peers
.
ethPeersWithoutTransacion
(
tx
.
Hash
())
peers
:=
h
.
peers
.
ethPeersWithoutTransac
t
ion
(
tx
.
Hash
())
// Send the block to a subset of our peers
// Send the block to a subset of our peers
transfer
:=
peers
[
:
int
(
math
.
Sqrt
(
float64
(
len
(
peers
))))]
transfer
:=
peers
[
:
int
(
math
.
Sqrt
(
float64
(
len
(
peers
))))]
for
_
,
peer
:=
range
transfer
{
for
_
,
peer
:=
range
transfer
{
txset
[
peer
]
=
append
(
txset
[
peer
],
tx
.
Hash
())
txset
[
peer
]
=
append
(
txset
[
peer
],
tx
.
Hash
())
}
}
log
.
Trace
(
"Broadcast transaction"
,
"hash"
,
tx
.
Hash
(),
"recipients"
,
len
(
peers
))
log
.
Trace
(
"Broadcast transaction"
,
"hash"
,
tx
.
Hash
(),
"recipients"
,
len
(
transfer
))
}
}
for
peer
,
hashes
:=
range
txset
{
for
peer
,
hashes
:=
range
txset
{
peer
.
AsyncSendTransactions
(
hashes
)
peer
.
AsyncSendTransactions
(
hashes
)
...
@@ -453,7 +453,7 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool)
...
@@ -453,7 +453,7 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool)
}
}
// Otherwise only broadcast the announcement to peers
// Otherwise only broadcast the announcement to peers
for
_
,
tx
:=
range
txs
{
for
_
,
tx
:=
range
txs
{
peers
:=
h
.
peers
.
ethPeersWithoutTransacion
(
tx
.
Hash
())
peers
:=
h
.
peers
.
ethPeersWithoutTransac
t
ion
(
tx
.
Hash
())
for
_
,
peer
:=
range
peers
{
for
_
,
peer
:=
range
peers
{
annos
[
peer
]
=
append
(
annos
[
peer
],
tx
.
Hash
())
annos
[
peer
]
=
append
(
annos
[
peer
],
tx
.
Hash
())
}
}
...
...
eth/peerset.go
View file @
49c2816d
...
@@ -243,9 +243,9 @@ func (ps *peerSet) ethPeersWithoutBlock(hash common.Hash) []*ethPeer {
...
@@ -243,9 +243,9 @@ func (ps *peerSet) ethPeersWithoutBlock(hash common.Hash) []*ethPeer {
return
list
return
list
}
}
// ethPeersWithoutTransacion retrieves a list of `eth` peers that do not have a
// ethPeersWithoutTransac
t
ion retrieves a list of `eth` peers that do not have a
// given transaction in their set of known hashes.
// given transaction in their set of known hashes.
func
(
ps
*
peerSet
)
ethPeersWithoutTransacion
(
hash
common
.
Hash
)
[]
*
ethPeer
{
func
(
ps
*
peerSet
)
ethPeersWithoutTransac
t
ion
(
hash
common
.
Hash
)
[]
*
ethPeer
{
ps
.
lock
.
RLock
()
ps
.
lock
.
RLock
()
defer
ps
.
lock
.
RUnlock
()
defer
ps
.
lock
.
RUnlock
()
...
...
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