Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
nodes
typescript
duniter
Commits
26e25b8c
Commit
26e25b8c
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#1041
Renewal could cause forks
parent
685b7aee
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/dal/sqliteDAL/MetaDAL.ts
+16
-1
16 additions, 1 deletion
app/lib/dal/sqliteDAL/MetaDAL.ts
with
16 additions
and
1 deletion
app/lib/dal/sqliteDAL/MetaDAL.ts
+
16
−
1
View file @
26e25b8c
...
...
@@ -348,7 +348,22 @@ export class MetaDAL extends AbstractSQLite<DBMeta> {
'
UPDATE i_index SET writtenOn = CAST(written_on as integer);
'
+
'
UPDATE s_index SET writtenOn = CAST(written_on as integer);
'
+
'
UPDATE c_index SET writtenOn = CAST(written_on as integer);
'
+
'
COMMIT;
'
'
COMMIT;
'
,
/**
* Feeds the m_index.chainable_on correctly
*/
24
:
async
(
conf
:
ConfDTO
)
=>
{
let
blockDAL
=
new
BlockDAL
(
this
.
driverCopy
)
let
mindexDAL
=
new
MIndexDAL
(
this
.
driverCopy
)
const
memberships
=
await
mindexDAL
.
query
(
'
SELECT * FROM m_index
'
)
for
(
const
ms
of
memberships
)
{
const
reference
=
await
blockDAL
.
getBlock
(
parseInt
(
ms
.
written_on
.
split
(
'
-
'
)[
0
]))
const
msPeriod
=
conf
.
msWindow
// It has the same value, as it was not defined on currency init
const
updateQuery
=
'
UPDATE m_index SET chainable_on =
'
+
(
reference
.
medianTime
+
msPeriod
)
+
'
WHERE pub =
\'
'
+
ms
.
pub
+
'
\'
AND written_on =
\'
'
+
ms
.
written_on
+
'
\'
'
await
mindexDAL
.
exec
(
updateQuery
)
}
},
};
async
init
()
{
...
...
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