From 21c778707f7d5590014952c8ed524b1198aa1182 Mon Sep 17 00:00:00 2001 From: disregardfiat Date: Wed, 17 Apr 2019 17:18:49 -0700 Subject: [PATCH] permissions from will be either active or posting role, active is new bool to hold active permission --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 1480497..a2f7594 100644 --- a/index.js +++ b/index.js @@ -100,7 +100,7 @@ module.exports = function(client, steem, currentBlockNumber=1, blockComputeSpeed }) } - function processBlock(block, num) { +function processBlock(block, num) { onNewBlock(num, block); var transactions = block.transactions; @@ -110,10 +110,13 @@ module.exports = function(client, steem, currentBlockNumber=1, blockComputeSpeed var op = transactions[i].operations[j]; if(op[0] === 'custom_json') { if(typeof onCustomJsonOperation[op[1].id] === 'function') { - var ip = JSON.parse(op[1].json) + var ip = JSON.parse(op[1].json), + from = op[1].required_posting_auths[0], + active = false ip.transaction_id = transactions[i].transaction_id ip.block_num = transactions[i].block_num - onCustomJsonOperation[op[1].id](ip, op[1].required_posting_auths[0]); + if(!from){from = op[1].required_auths[0];active=true} + onCustomJsonOperation[op[1].id](ip, from, active); } } else if(onOperation[op[0]] !== undefined) { op[1].transaction_id = transactions[i].transaction_id