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
0dbb3b16
Unverified
Commit
0dbb3b16
authored
Oct 04, 2021
by
Ferran Borreguero
Committed by
GitHub
Oct 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/protocols/eth: replace array with counter in txn broadcaster (#23656)
parent
5a0e1d88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
broadcast.go
eth/protocols/eth/broadcast.go
+5
-5
No files found.
eth/protocols/eth/broadcast.go
View file @
0dbb3b16
...
...
@@ -75,18 +75,18 @@ func (p *Peer) broadcastTransactions() {
if
done
==
nil
&&
len
(
queue
)
>
0
{
// Pile transaction until we reach our allowed network limit
var
(
hashes
[]
common
.
Hash
txs
[]
*
types
.
Transaction
size
common
.
StorageSize
hashes
Count
uint64
txs
[]
*
types
.
Transaction
size
common
.
StorageSize
)
for
i
:=
0
;
i
<
len
(
queue
)
&&
size
<
maxTxPacketSize
;
i
++
{
if
tx
:=
p
.
txpool
.
Get
(
queue
[
i
]);
tx
!=
nil
{
txs
=
append
(
txs
,
tx
)
size
+=
tx
.
Size
()
}
hashes
=
append
(
hashes
,
queue
[
i
])
hashes
Count
++
}
queue
=
queue
[
:
copy
(
queue
,
queue
[
len
(
hashes
)
:
])]
queue
=
queue
[
:
copy
(
queue
,
queue
[
hashesCount
:
])]
// If there's anything available to transfer, fire up an async writer
if
len
(
txs
)
>
0
{
...
...
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