Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
5e4af21f
Commit
5e4af21f
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[fix] bc: do not request fork blocks where current block is genesis
parent
8d8defa7
No related branches found
No related tags found
2 merge requests
!232
Elois/local validation
,
!221
WIP: Resolve "Fail to revert block with transactions"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/blockchain/blockchain/src/requests/sent.rs
+13
-10
13 additions, 10 deletions
lib/modules/blockchain/blockchain/src/requests/sent.rs
with
13 additions
and
10 deletions
lib/modules/blockchain/blockchain/src/requests/sent.rs
+
13
−
10
View file @
5e4af21f
...
...
@@ -49,6 +49,7 @@ pub fn request_fork_blocks(bc: &mut BlockchainModule, now: SystemTime) {
bc
.last_request_fork_blocks
=
now
;
// Request all blocks in fork window size
if
let
Some
(
currency_params
)
=
bc
.currency_params
{
if
bc
.current_blockstamp.id
>
BlockNumber
(
0
)
{
let
fork_window_size
=
currency_params
.fork_window_size
as
u32
;
let
from
=
if
bc
.current_blockstamp.id
.0
>
fork_window_size
{
BlockNumber
(
bc
.current_blockstamp.id
.0
-
fork_window_size
)
...
...
@@ -56,13 +57,15 @@ pub fn request_fork_blocks(bc: &mut BlockchainModule, now: SystemTime) {
BlockNumber
(
0
)
};
let
to
=
bc
.current_blockstamp.id
;
let
new_pending_network_requests
=
dunp
::
queries
::
request_blocks_from_to
(
bc
,
from
,
to
);
let
new_pending_network_requests
=
dunp
::
queries
::
request_blocks_from_to
(
bc
,
from
,
to
);
for
(
new_req_id
,
new_req
)
in
new_pending_network_requests
{
bc
.pending_network_requests
.insert
(
new_req_id
,
new_req
);
}
}
}
}
}
pub
fn
request_next_main_blocks
(
bc
:
&
mut
BlockchainModule
,
now
:
SystemTime
)
{
// Choose frequency
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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