{"action":"created","comment":{"url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/comments/31586749","id":31586749,"diff_hunk":"@@ -2304,86 +2304,66 @@ int mastercore::ClassAgnosticWalletTXBuilder(const string &senderAddress, const\n     }\n }\n \n-int CMPTxList::setLastAlert(int blockHeight)\n+bool CMPTxList::setLastAlert(int blockHeight)\n {\n-    if (blockHeight > chainActive.Height()) blockHeight = chainActive.Height();\n-    if (!pdb) return 0;\n-    Slice skey, svalue;\n+    if (blockHeight > GetHeight()) blockHeight = GetHeight();\n+    if (!pdb) return false;\n     Iterator* it = NewIterator();\n-    string lastAlertTxid;\n-    string lastAlertData;\n-    int64_t lastAlertBlock = 0;\n-    for(it->SeekToFirst(); it->Valid(); it->Next())\n-    {\n-       skey = it->key();\n-       svalue = it->value();\n-       string itData = svalue.ToString();\n-       std::vector<std::string> vstr;\n-       boost::split(vstr, itData, boost::is_any_of(\":\"), token_compress_on);\n-       // we expect 5 tokens\n-       if (4 == vstr.size())\n-       {\n-           if (atoi(vstr[2]) == OMNICORE_MESSAGE_TYPE_ALERT) // is it an alert?\n-           {\n-               if (atoi(vstr[0]) == 1) // is it valid?\n-               {\n-                    if ((atoi(vstr[1]) > lastAlertBlock) && (atoi(vstr[1]) <= blockHeight)) // is it the most recent and within our parsed range?\n-                    {\n-                        lastAlertTxid = skey.ToString();\n-                        lastAlertData = svalue.ToString();\n-                        lastAlertBlock = atoi(vstr[1]);\n-                    }\n-               }\n+    std::string lastAlertTxid;\n+    std::string lastAlertData;\n+    int lastAlertBlock = 0;\n+    for (it->SeekToFirst(); it->Valid(); it->Next()) {\n+        Slice skey = it->key();\n+        Slice svalue = it->value();\n+        std::string itValue = svalue.ToString();\n+        std::vector<std::string> vstr;\n+        boost::split(vstr, itValue, boost::is_any_of(\":\"), boost::token_compress_on);\n+        // we expect 4 tokens\n+        if (4 == vstr.size()) {\n+           // is it a valid alert?\n+            if (atoi(vstr[2]) == OMNICORE_MESSAGE_TYPE_ALERT && atoi(vstr[0]) == 1) {\n+                // is it the most recent and within our parsed range?\n+                if (atoi(vstr[1]) > lastAlertBlock && atoi(vstr[1]) <= blockHeight) {\n+                    lastAlertTxid = skey.ToString();\n+                    lastAlertData = svalue.ToString();\n+                    lastAlertBlock = atoi(vstr[1]);\n+                }\n            }\n        }\n     }\n     delete it;\n \n     // if lastAlertTxid is not empty, load the alert and see if it's still valid - if so, copy to global_alert_message\n-    if(lastAlertTxid.empty())\n-    {\n+    if (lastAlertTxid.empty()) {\n         PrintToLog(\"DEBUG ALERT No alerts found to load\\n\");\n+        return false;\n     }\n-    else\n-    {\n-        PrintToLog(\"DEBUG ALERT Loading lastAlertTxid %s\\n\", lastAlertTxid);\n-\n-        // reparse lastAlertTxid\n-        uint256 hash;\n-        hash.SetHex(lastAlertTxid);\n-        CTransaction wtx;\n-        uint256 blockHash = 0;\n-        if (!GetTransaction(hash, wtx, blockHash, true)) //can't find transaction\n-        {\n-            PrintToLog(\"DEBUG ALERT Unable to load lastAlertTxid, transaction not found\\n\");\n-        }\n-        else // note reparsing here is unavoidable because we've only loaded a txid and have no other alert info stored\n-        {\n-            CMPTransaction mp_obj;\n-            int parseRC = ParseTransaction(wtx, blockHeight, 0, mp_obj);\n-            string new_global_alert_message;\n-            if (0 <= parseRC)\n-            {\n-                if (0<=mp_obj.step1())\n-                {\n-                    if(65535 == mp_obj.getType())\n-                    {\n-                        // TODO: use new parsing/interpretation functions\n-                        if (0 == mp_obj.step2_Alert(&new_global_alert_message))\n-                        {\n-                            SetOmniCoreAlert(new_global_alert_message);\n-                            // check if expired\n-                            CBlockIndex* pBlockIndex = chainActive[blockHeight];\n-                            if (pBlockIndex != NULL) {\n-                                CheckExpiredAlerts(blockHeight, pBlockIndex->GetBlockTime());\n-                            }\n-                        }\n-                    }\n-                }\n+\n+    PrintToLog(\"DEBUG ALERT Loading lastAlertTxid %s\\n\", lastAlertTxid);\n+\n+    // reparse the last alert\n+    uint256 hash(lastAlertTxid);\n+    CTransaction tx;\n+    uint256 blockHash;\n+    if (!GetTransaction(hash, tx, blockHash, true)) {\n+        PrintToLog(\"DEBUG ALERT Unable to load lastAlertTxid, transaction not found\\n\");\n+        return false;\n+    }\n+\n+    CMPTransaction alertTx;\n+    if (ParseTransaction(tx, blockHeight, 0, alertTx) == 0) {\n+        // TODO: calling interpretPacket, and logic in general, outside of the\n+        // regular flow seems dangerous\n+        if (alertTx.interpretPacket() == 0) {","path":"src/omnicore/omnicore.cpp","position":120,"original_position":120,"commit_id":"c7c2d7865480034a34aaaf764d2e13f21986b1d9","original_commit_id":"c7c2d7865480034a34aaaf764d2e13f21986b1d9","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"body":"I'm not sure what you mean by forcing notifications?","created_at":"2015-06-03T01:04:20Z","updated_at":"2015-06-03T01:04:20Z","html_url":"https://github.com/zathras-crypto/omnicore/pull/74#discussion_r31586749","pull_request_url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/comments/31586749"},"html":{"href":"https://github.com/zathras-crypto/omnicore/pull/74#discussion_r31586749"},"pull_request":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74","id":36604187,"html_url":"https://github.com/zathras-crypto/omnicore/pull/74","diff_url":"https://github.com/zathras-crypto/omnicore/pull/74.diff","patch_url":"https://github.com/zathras-crypto/omnicore/pull/74.patch","issue_url":"https://api.github.com/repos/zathras-crypto/omnicore/issues/74","number":74,"state":"open","locked":false,"title":"Replace and remove deprecated step/parsing functions","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"body":"They are no longer needed.\r\n\r\nEdit: should be finished now.","created_at":"2015-06-01T07:21:28Z","updated_at":"2015-06-03T01:04:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4581d38b42b80c4fd492d0594ba152c0f07cbf94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74/commits","review_comments_url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74/comments","review_comment_url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zathras-crypto/omnicore/issues/74/comments","statuses_url":"https://api.github.com/repos/zathras-crypto/omnicore/statuses/c7c2d7865480034a34aaaf764d2e13f21986b1d9","head":{"label":"dexX7:oc-0.10-rpc-replace-steps","ref":"oc-0.10-rpc-replace-steps","sha":"c7c2d7865480034a34aaaf764d2e13f21986b1d9","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"repo":{"id":18346213,"name":"bitcoin","full_name":"dexX7/bitcoin","owner":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dexX7/bitcoin","description":"Bitcoin Core address-indexed mod","fork":true,"url":"https://api.github.com/repos/dexX7/bitcoin","forks_url":"https://api.github.com/repos/dexX7/bitcoin/forks","keys_url":"https://api.github.com/repos/dexX7/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dexX7/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dexX7/bitcoin/teams","hooks_url":"https://api.github.com/repos/dexX7/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/dexX7/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/dexX7/bitcoin/events","assignees_url":"https://api.github.com/repos/dexX7/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/dexX7/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/dexX7/bitcoin/tags","blobs_url":"https://api.github.com/repos/dexX7/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dexX7/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dexX7/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/dexX7/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dexX7/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/dexX7/bitcoin/languages","stargazers_url":"https://api.github.com/repos/dexX7/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/dexX7/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/dexX7/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/dexX7/bitcoin/subscription","commits_url":"https://api.github.com/repos/dexX7/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/dexX7/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/dexX7/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/dexX7/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/dexX7/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/dexX7/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dexX7/bitcoin/merges","archive_url":"https://api.github.com/repos/dexX7/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dexX7/bitcoin/downloads","issues_url":"https://api.github.com/repos/dexX7/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/dexX7/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/dexX7/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/dexX7/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dexX7/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/dexX7/bitcoin/releases{/id}","created_at":"2014-04-01T21:53:13Z","updated_at":"2015-05-14T00:34:28Z","pushed_at":"2015-06-02T16:20:15Z","git_url":"git://github.com/dexX7/bitcoin.git","ssh_url":"git@github.com:dexX7/bitcoin.git","clone_url":"https://github.com/dexX7/bitcoin.git","svn_url":"https://github.com/dexX7/bitcoin","homepage":"","size":59039,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"addrindex-0.10"}},"base":{"label":"zathras-crypto:0.0.10-Z-MetaDExRPC","ref":"0.0.10-Z-MetaDExRPC","sha":"3bbe9658395fc236c2a15752a0ce4c4683d2616f","user":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/received_events","type":"User","site_admin":false},"repo":{"id":19960841,"name":"omnicore","full_name":"zathras-crypto/omnicore","owner":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zathras-crypto/omnicore","description":"mastercore info","fork":true,"url":"https://api.github.com/repos/zathras-crypto/omnicore","forks_url":"https://api.github.com/repos/zathras-crypto/omnicore/forks","keys_url":"https://api.github.com/repos/zathras-crypto/omnicore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zathras-crypto/omnicore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zathras-crypto/omnicore/teams","hooks_url":"https://api.github.com/repos/zathras-crypto/omnicore/hooks","issue_events_url":"https://api.github.com/repos/zathras-crypto/omnicore/issues/events{/number}","events_url":"https://api.github.com/repos/zathras-crypto/omnicore/events","assignees_url":"https://api.github.com/repos/zathras-crypto/omnicore/assignees{/user}","branches_url":"https://api.github.com/repos/zathras-crypto/omnicore/branches{/branch}","tags_url":"https://api.github.com/repos/zathras-crypto/omnicore/tags","blobs_url":"https://api.github.com/repos/zathras-crypto/omnicore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zathras-crypto/omnicore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zathras-crypto/omnicore/git/refs{/sha}","trees_url":"https://api.github.com/repos/zathras-crypto/omnicore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zathras-crypto/omnicore/statuses/{sha}","languages_url":"https://api.github.com/repos/zathras-crypto/omnicore/languages","stargazers_url":"https://api.github.com/repos/zathras-crypto/omnicore/stargazers","contributors_url":"https://api.github.com/repos/zathras-crypto/omnicore/contributors","subscribers_url":"https://api.github.com/repos/zathras-crypto/omnicore/subscribers","subscription_url":"https://api.github.com/repos/zathras-crypto/omnicore/subscription","commits_url":"https://api.github.com/repos/zathras-crypto/omnicore/commits{/sha}","git_commits_url":"https://api.github.com/repos/zathras-crypto/omnicore/git/commits{/sha}","comments_url":"https://api.github.com/repos/zathras-crypto/omnicore/comments{/number}","issue_comment_url":"https://api.github.com/repos/zathras-crypto/omnicore/issues/comments{/number}","contents_url":"https://api.github.com/repos/zathras-crypto/omnicore/contents/{+path}","compare_url":"https://api.github.com/repos/zathras-crypto/omnicore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zathras-crypto/omnicore/merges","archive_url":"https://api.github.com/repos/zathras-crypto/omnicore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zathras-crypto/omnicore/downloads","issues_url":"https://api.github.com/repos/zathras-crypto/omnicore/issues{/number}","pulls_url":"https://api.github.com/repos/zathras-crypto/omnicore/pulls{/number}","milestones_url":"https://api.github.com/repos/zathras-crypto/omnicore/milestones{/number}","notifications_url":"https://api.github.com/repos/zathras-crypto/omnicore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zathras-crypto/omnicore/labels{/name}","releases_url":"https://api.github.com/repos/zathras-crypto/omnicore/releases{/id}","created_at":"2014-05-19T23:15:09Z","updated_at":"2015-05-18T06:43:01Z","pushed_at":"2015-06-02T07:04:14Z","git_url":"git://github.com/zathras-crypto/omnicore.git","ssh_url":"git@github.com:zathras-crypto/omnicore.git","clone_url":"https://github.com/zathras-crypto/omnicore.git","svn_url":"https://github.com/zathras-crypto/omnicore","homepage":"mastercoin.org","size":52931,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"0.0.8-Z-UIAlpha"}},"_links":{"self":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74"},"html":{"href":"https://github.com/zathras-crypto/omnicore/pull/74"},"issue":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/issues/74"},"comments":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/zathras-crypto/omnicore/statuses/c7c2d7865480034a34aaaf764d2e13f21986b1d9"}}}}