Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Truite
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
EcoMobiCoin
Truite
Commits
ec54d416
Commit
ec54d416
authored
1 year ago
by
Jerome DESCHAMPS
Browse files
Options
Downloads
Patches
Plain Diff
Fixed error in block spec collection
parent
ace7b0de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!75
Resolve "Implement Demurrage"
Pipeline
#5672
passed
1 year ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rpc/miner.rs
+13
-1
13 additions, 1 deletion
src/rpc/miner.rs
with
13 additions
and
1 deletion
src/rpc/miner.rs
+
13
−
1
View file @
ec54d416
...
...
@@ -13,6 +13,7 @@ use mdbx::WriteMap;
use
rand
::
Rng
;
use
tracing
::{
debug
,
info
};
use
crate
::
consensus
::
miner
::
get_latest_parent_header
;
use
crate
::{
accessors
::
chain
,
consensus
::{
...
...
@@ -57,9 +58,20 @@ impl MinerApiServer for MinerRpc {
async
fn
mine
(
&
self
,
behavior
:
BehaviorWithSignature
)
->
RpcResult
<
ExecutedBlock
>
{
let
db1
=
Arc
::
clone
(
&
self
.db
);
let
db2
=
Arc
::
clone
(
&
self
.db
);
let
db3
=
Arc
::
clone
(
&
self
.db
);
let
tx
=
db3
.begin
()
?
;
let
last_header
=
get_latest_parent_header
(
&
tx
);
let
last_block_number
=
{
if
last_header
.is_err
()
{
BlockNumber
(
0
)
}
else
{
let
header
=
last_header
.unwrap
();
header
.number
}
};
let
chain_spec
=
self
.chain_spec
.clone
();
let
block_spec
=
self
.chain_spec
.collect_block_spec
(
B
lock
N
umber
(
0
)
);
let
block_spec
=
self
.chain_spec
.collect_block_spec
(
last_b
lock
_n
umber
);
let
node
=
self
.node
.clone
();
tokio
::
task
::
spawn_blocking
(
move
||
{
...
...
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