From 5b20930d5c52e839f2b648c250413ba26b285c6a Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 16 Aug 2018 19:02:14 -0500 Subject: [PATCH] hopefully fixed block sync issue --- docs/whitepaper.md | 10 ++++++++-- onionr/api.py | 2 +- onionr/communicator2.py | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/whitepaper.md b/docs/whitepaper.md index 789f8e47..e791b83c 100644 --- a/docs/whitepaper.md +++ b/docs/whitepaper.md @@ -86,6 +86,12 @@ Blocks are stored indefinitely until the allocated space is filled, at which poi ## Block Timestamping -Onionr can provide evidence when a block was inserted by requesting other users to sign a hash of the current time with the block data hash: sha3_256(time + sha3_256(block data)). +Onionr can provide evidence of when a block was inserted by requesting other users to sign a hash of the current time with the block data hash: sha3_256(time + sha3_256(block data)). -This can be done either by the creator of the block prior to generation, or by any node after insertion. \ No newline at end of file +This can be done either by the creator of the block prior to generation, or by any node after insertion. + +In addition, randomness beacons such as the one operated by [NIST](https://beacon.nist.gov/home) or the hash of the latest blocks in a cryptocurrency network could be used to affirm that a block was at least not *created* before a given time. + +# Direct Connections + +We propose a system to \ No newline at end of file diff --git a/onionr/api.py b/onionr/api.py index 34c320d9..37c6b531 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -474,7 +474,7 @@ class API: elif action == 'getData': resp = '' if self._utils.validateHash(data): - if not os.path.exists('data/blocks/' + data + '.db'): + if os.path.exists('data/blocks/' + data + '.dat'): block = Block(hash=data.encode(), core=self._core) resp = base64.b64encode(block.getRaw().encode()).decode() if len(resp) == 0: diff --git a/onionr/communicator2.py b/onionr/communicator2.py index 019dedb8..5a6aeee6 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -216,6 +216,7 @@ class OnionrCommunicatorDaemon: logger.warn('POW failed for block ' + blockHash) else: logger.warn('Metadata for ' + blockHash + ' is invalid.') + self._core._blacklist.addToDB(blockHash) else: # if block didn't meet expected hash tempHash = self._core._crypto.sha3Hash(content) # lazy hack, TODO use var