Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
duniter4j
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Show more breadcrumbs
clients
java
duniter4j
Commits
556acf46
Commit
556acf46
authored
7 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
Add a log (warn) to find the origin of issuer #17
parent
905b1d91
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
duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/BlockchainBlocks.java
+14
-1
14 additions, 1 deletion
...a/org/duniter/core/client/model/bma/BlockchainBlocks.java
with
14 additions
and
1 deletion
duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/BlockchainBlocks.java
+
14
−
1
View file @
556acf46
...
@@ -23,10 +23,11 @@ package org.duniter.core.client.model.bma;
...
@@ -23,10 +23,11 @@ package org.duniter.core.client.model.bma;
*/
*/
import
org.duniter.core.util.Preconditions
;
import
org.duniter.core.util.Preconditions
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Predicate
;
import
java.util.function.Predicate
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -38,6 +39,8 @@ import java.util.stream.IntStream;
...
@@ -38,6 +39,8 @@ import java.util.stream.IntStream;
*/
*/
public
final
class
BlockchainBlocks
{
public
final
class
BlockchainBlocks
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BlockchainBlocks
.
class
);
public
static
final
Pattern
SIG_PUBKEY_PATTERN
=
Pattern
.
compile
(
"SIG\\(([^)]+)\\)"
);
public
static
final
Pattern
SIG_PUBKEY_PATTERN
=
Pattern
.
compile
(
"SIG\\(([^)]+)\\)"
);
public
static
final
Pattern
TX_INPUT_CONDITION_FUNCTION
=
Pattern
.
compile
(
"(SIG|XHX)\\(([^)]+)\\)"
);
public
static
final
Pattern
TX_INPUT_CONDITION_FUNCTION
=
Pattern
.
compile
(
"(SIG|XHX)\\(([^)]+)\\)"
);
...
@@ -112,10 +115,20 @@ public final class BlockchainBlocks {
...
@@ -112,10 +115,20 @@ public final class BlockchainBlocks {
Preconditions
.
checkNotNull
(
tx
);
Preconditions
.
checkNotNull
(
tx
);
final
Map
<
Integer
,
List
<
String
>>
inputIssuers
=
getInputIssuers
(
tx
);
final
Map
<
Integer
,
List
<
String
>>
inputIssuers
=
getInputIssuers
(
tx
);
if
(
inputIssuers
==
null
||
inputIssuers
.
size
()
==
0
)
{
log
.
warn
(
"Invalid block TX: no issuer found ! "
,
tx
.
toString
());
}
return
IntStream
.
range
(
0
,
tx
.
getInputs
().
length
)
return
IntStream
.
range
(
0
,
tx
.
getInputs
().
length
)
.
mapToObj
(
i
->
{
.
mapToObj
(
i
->
{
TxInput
txInput
=
parseInput
(
tx
.
getInputs
()[
i
]);
TxInput
txInput
=
parseInput
(
tx
.
getInputs
()[
i
]);
if
(
txInput
==
null
)
{
log
.
warn
(
String
.
format
(
"Invalid block TX: unable to parse inputs: %s"
,
i
,
tx
.
getInputs
()[
i
]));
txInput
=
new
TxInput
();
txInput
.
amount
=
0
;
txInput
.
unitbase
=
0
;
txInput
.
type
=
"T"
;
}
txInput
.
issuers
=
inputIssuers
.
get
(
i
);
txInput
.
issuers
=
inputIssuers
.
get
(
i
);
return
txInput
;
return
txInput
;
})
})
...
...
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