Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
152bb308
Commit
152bb308
authored
6 years ago
by
asynchronous rob
Committed by
Gav Wood
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
limit number of transactions when building blocks (#91)
parent
ccb79c05
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polkadot/consensus/src/lib.rs
+3
-1
3 additions, 1 deletion
polkadot/consensus/src/lib.rs
with
3 additions
and
1 deletion
polkadot/consensus/src/lib.rs
+
3
−
1
View file @
152bb308
...
...
@@ -628,6 +628,8 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
use
client
::
block_builder
::
BlockBuilder
;
use
runtime_primitives
::
traits
::{
Hash
as
HashT
,
BlakeTwo256
};
const
MAX_TRANSACTIONS
:
usize
=
40
;
let
inherent_data
=
InherentData
{
timestamp
:
self
.believed_minimum_timestamp
,
parachains
:
candidates
,
...
...
@@ -648,7 +650,7 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
let
mut
pending_size
=
0
;
let
ready_iter
=
self
.transaction_pool
.ready
();
for
ready
in
ready_iter
{
for
ready
in
ready_iter
.take
(
MAX_TRANSACTIONS
)
{
let
encoded_size
=
ready
.data
.encode
()
.len
();
if
pending_size
+
encoded_size
>=
MAX_TRANSACTIONS_SIZE
{
break
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment