Skip to content
Snippets Groups Projects

replayfix+listfeature

Closed Robert Martin-Legene requested to merge bugfix+feature into master
2 files
+ 12
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -8,8 +8,16 @@ contract ProofOfExistence {
mapping (uint256 => Dato) private hashstore;
function stamp(uint256 ots, uint256 file_hash) public {
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
function stamp(uint256[] incoming) public {
uint256 len = incoming.length;
uint256 i = 0;
while ( i+1 < len )
{
uint256 ots = incoming[i++];
uint256 file_hash = incoming[i++];
if ( hashstore[ots] == 0 )
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
}
}
function verify(uint256 ots, uint256 file_hash) public view returns(bool){
@@ -26,4 +34,4 @@ contract ProofOfExistence {
Dato memory dato = hashstore[ots];
return dato.blockNumber;
}
}
\ No newline at end of file
}
Loading