diff --git a/hush-hush.js b/hush-hush.js index a6b631c..d796cc6 100644 --- a/hush-hush.js +++ b/hush-hush.js @@ -139,7 +139,11 @@ async function findMessages(){ document.getElementById('memUsage').innerText = getReadableFileSizeString(current + ((basicTextEncoder.encode(data)).length + block.length)) } try{ - let metadata = JSON.parse(d.split("\n")[0]) + var metadata = JSON.parse(d.split("\n")[0]) + // Make sure the block is an actual post so nodes can't send us stuff unrelated to dapp + if (JSON.parse(metadata['meta'])['type'] !== 'kic'){ + throw new Error("Not correct block type: " + block) + } } catch(e){ console.debug(e) diff --git a/powworker.js b/powworker.js index 28b2271..d040792 100644 --- a/powworker.js +++ b/powworker.js @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -importScripts("onionr-jspow/index.js") +importScripts("jspow/index.js") importScripts("sha3.js") self.addEventListener('message', function(e) {