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
062602a7
Commit
062602a7
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#1277
Remove txs from the pool once included in our submitted block
parent
62a7d6c1
No related branches found
No related tags found
1 merge request
!1248
[fix] #1277 G1-Test is stuck because of wrong generated blocks (chained transactions)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/service/BlockchainService.ts
+8
-3
8 additions, 3 deletions
app/service/BlockchainService.ts
with
8 additions
and
3 deletions
app/service/BlockchainService.ts
+
8
−
3
View file @
062602a7
import
{
IdentityForRequirements
}
from
'
./BlockchainService
'
;
import
{
IdentityForRequirements
}
from
'
./BlockchainService
'
;
"
use strict
"
;
import
{
Server
}
from
"
../../server
"
import
{
Server
}
from
"
../../server
"
import
{
GlobalFifoPromise
}
from
"
./GlobalFifoPromise
"
import
{
GlobalFifoPromise
}
from
"
./GlobalFifoPromise
"
import
{
BlockchainContext
}
from
"
../lib/computation/BlockchainContext
"
import
{
BlockchainContext
}
from
"
../lib/computation/BlockchainContext
"
...
@@ -7,7 +6,6 @@ import {ConfDTO} from "../lib/dto/ConfDTO"
...
@@ -7,7 +6,6 @@ import {ConfDTO} from "../lib/dto/ConfDTO"
import
{
FileDAL
}
from
"
../lib/dal/fileDAL
"
import
{
FileDAL
}
from
"
../lib/dal/fileDAL
"
import
{
QuickSynchronizer
}
from
"
../lib/computation/QuickSync
"
import
{
QuickSynchronizer
}
from
"
../lib/computation/QuickSync
"
import
{
BlockDTO
}
from
"
../lib/dto/BlockDTO
"
import
{
BlockDTO
}
from
"
../lib/dto/BlockDTO
"
import
{
DBIdentity
}
from
"
../lib/dal/sqliteDAL/IdentityDAL
"
import
{
DBBlock
}
from
"
../lib/db/DBBlock
"
import
{
DBBlock
}
from
"
../lib/db/DBBlock
"
import
{
GLOBAL_RULES_HELPERS
}
from
"
../lib/rules/global_rules
"
import
{
GLOBAL_RULES_HELPERS
}
from
"
../lib/rules/global_rules
"
import
{
parsers
}
from
"
../lib/common-libs/parsers/index
"
import
{
parsers
}
from
"
../lib/common-libs/parsers/index
"
...
@@ -18,6 +16,8 @@ import {LOCAL_RULES_FUNCTIONS} from "../lib/rules/local_rules"
...
@@ -18,6 +16,8 @@ import {LOCAL_RULES_FUNCTIONS} from "../lib/rules/local_rules"
import
{
Switcher
,
SwitcherDao
}
from
"
../lib/blockchain/Switcher
"
import
{
Switcher
,
SwitcherDao
}
from
"
../lib/blockchain/Switcher
"
import
{
OtherConstants
}
from
"
../lib/other_constants
"
import
{
OtherConstants
}
from
"
../lib/other_constants
"
"
use strict
"
;
const
_
=
require
(
'
underscore
'
);
const
_
=
require
(
'
underscore
'
);
const
constants
=
require
(
'
../lib/constants
'
);
const
constants
=
require
(
'
../lib/constants
'
);
...
@@ -206,6 +206,11 @@ export class BlockchainService extends FIFOService {
...
@@ -206,6 +206,11 @@ export class BlockchainService extends FIFOService {
while
(
!
added
&&
i
<
potentials
.
length
)
{
while
(
!
added
&&
i
<
potentials
.
length
)
{
const
dto
=
BlockDTO
.
fromJSONObject
(
potentials
[
i
])
const
dto
=
BlockDTO
.
fromJSONObject
(
potentials
[
i
])
try
{
try
{
if
(
dto
.
issuer
===
this
.
conf
.
pair
.
pub
)
{
for
(
const
tx
of
dto
.
transactions
)
{
await
this
.
dal
.
removeTxByHash
(
tx
.
hash
);
}
}
const
addedBlock
=
await
this
.
mainContext
.
checkAndAddBlock
(
dto
)
const
addedBlock
=
await
this
.
mainContext
.
checkAndAddBlock
(
dto
)
added
=
true
added
=
true
this
.
push
({
this
.
push
({
...
...
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