ensure posts are posts and not other blocks
This commit is contained in:
parent
ecba9555d9
commit
7056475e17
@ -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)
|
||||
|
@ -15,7 +15,7 @@
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
importScripts("onionr-jspow/index.js")
|
||||
importScripts("jspow/index.js")
|
||||
importScripts("sha3.js")
|
||||
|
||||
self.addEventListener('message', function(e) {
|
||||
|
Loading…
Reference in New Issue
Block a user