From c70ab9f26316ae4cefb9d2300680c82702257310 Mon Sep 17 00:00:00 2001 From: Evan Chou Date: Sat, 22 May 2021 11:47:45 +0000 Subject: [PATCH] gate new streamer behavior on forking block --- plugins/Streamer.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/plugins/Streamer.js b/plugins/Streamer.js index dee26944..60da1d0f 100644 --- a/plugins/Streamer.js +++ b/plugins/Streamer.js @@ -114,21 +114,23 @@ const parseTransactions = (refBlockNumber, block) => { sscTransactions = Array.isArray(commentBody.json) ? commentBody.json : [commentBody.json]; } catch (e) { - // If this fails to parse, treat as a comment op - id = `ssc-${chainIdentifier}`; - permlink = operation[1].permlink; // eslint-disable-line prefer-destructuring - sscTransactions = [ - { - contractName: 'comments', - contractAction: 'comment', - contractPayload: { - author: operation[1].author, - jsonMetadata: commentMeta, - parentAuthor: operation[1].parent_author, - parentPermlink: operation[1].parent_permlink, + // If this fails to parse, treat as a comment op, only after specified block + if (refBlockNumber >= 54106800) { + id = `ssc-${chainIdentifier}`; + permlink = operation[1].permlink; // eslint-disable-line prefer-destructuring + sscTransactions = [ + { + contractName: 'comments', + contractAction: 'comment', + contractPayload: { + author: operation[1].author, + jsonMetadata: commentMeta, + parentAuthor: operation[1].parent_author, + parentPermlink: operation[1].parent_permlink, + }, }, - }, - ]; + ]; + } } } } else if (operation[0] === 'comment_options') {