Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSA
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
blockchain
TSA
Commits
cf1a8a77
Commit
cf1a8a77
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Prevenir ataque replay
parent
eccf2757
No related branches found
No related tags found
1 merge request
!1
replayfix+listfeature
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SmartContracts/ProofOfExistence.sol
+3
-2
3 additions, 2 deletions
SmartContracts/ProofOfExistence.sol
with
3 additions
and
2 deletions
SmartContracts/ProofOfExistence.sol
+
3
−
2
View file @
cf1a8a77
...
@@ -9,7 +9,8 @@ contract ProofOfExistence {
...
@@ -9,7 +9,8 @@ contract ProofOfExistence {
function stamp(uint256 ots, uint256 file_hash) public {
function stamp(uint256 ots, uint256 file_hash) public {
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
if ( hashstore[ots] == 0 )
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
}
}
function verify(uint256 ots, uint256 file_hash) public view returns(bool){
function verify(uint256 ots, uint256 file_hash) public view returns(bool){
...
@@ -26,4 +27,4 @@ contract ProofOfExistence {
...
@@ -26,4 +27,4 @@ contract ProofOfExistence {
Dato memory dato = hashstore[ots];
Dato memory dato = hashstore[ots];
return dato.blockNumber;
return dato.blockNumber;
}
}
}
}
\ No newline at end of file
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