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
af6eaaea
Commit
af6eaaea
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[fix] blockchain: remove fork_blocks only if not already removed
parent
cb1d076a
Branches
Branches containing commit
No related tags found
1 merge request
!193
Resolve "Migrate high-volume DBs to LMDB"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/blockchain/bc-db-writer/src/blocks.rs
+6
-1
6 additions, 1 deletion
lib/modules/blockchain/bc-db-writer/src/blocks.rs
lib/modules/blockchain/bc-db-writer/src/blocks/fork_tree.rs
+6
-1
6 additions, 1 deletion
lib/modules/blockchain/bc-db-writer/src/blocks/fork_tree.rs
with
12 additions
and
2 deletions
lib/modules/blockchain/bc-db-writer/src/blocks.rs
+
6
−
1
View file @
af6eaaea
...
...
@@ -78,9 +78,14 @@ pub fn insert_new_head_block(
// Remove too old blocks
for
blockstamp
in
removed_blockstamps
{
let
blockstamp_bytes
:
Vec
<
u8
>
=
blockstamp
.into
();
if
fork_blocks_store
.get
(
w
.as_ref
(),
&
blockstamp_bytes
)
?
.is_some
()
{
fork_blocks_store
.delete
(
w
.as_mut
(),
&
blockstamp_bytes
)
?
;
}
}
}
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
lib/modules/blockchain/bc-db-writer/src/blocks/fork_tree.rs
+
6
−
1
View file @
af6eaaea
...
...
@@ -87,8 +87,13 @@ pub fn change_main_branch(
let
fork_blocks_store
=
db
.get_store
(
FORK_BLOCKS
);
for
blockstamp
in
removed_blockstamps
{
let
blockstamp_bytes
:
Vec
<
u8
>
=
blockstamp
.into
();
if
fork_blocks_store
.get
(
w
.as_ref
(),
&
blockstamp_bytes
)
?
.is_some
()
{
fork_blocks_store
.delete
(
w
.as_mut
(),
&
blockstamp_bytes
)
?
;
}
}
Ok
(())
}
...
...
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