{"action":"created","comment":{"url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/comments/238331936","pull_request_review_id":180846673,"id":238331936,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODMzMTkzNg==","diff_hunk":"@@ -693,10 +707,156 @@ int CryptoNoteProtocolHandler::handleRequestTxPool(int command, NOTIFY_REQUEST_T\n   return 1;\n }\n \n+int CryptoNoteProtocolHandler::handle_notify_new_lite_block(int command, NOTIFY_NEW_LITE_BLOCK::request& arg,\n+                                                     CryptoNoteConnectionContext& context) {\n+  logger(Logging::TRACE) << context << \"NOTIFY_NEW_LITE_BLOCK (hop \" << arg.hop << \")\";\n+  updateObservedHeight(arg.current_blockchain_height, context);\n+  context.m_remote_blockchain_height = arg.current_blockchain_height;\n+  if (context.m_state != CryptoNoteConnectionContext::state_normal) {\n+    return 1;\n+  }\n+\n+  BlockTemplate newBlockTemplate;\n+  if(fromBinaryArray(newBlockTemplate, arg.b.block)) {\n+    std::vector<BinaryArray> have_txs;\n+    std::vector<Crypto::Hash> need_txs;\n+\n+    if (!arg.b.transactions.empty()) {\n+      for (const BinaryArray& txBlob: arg.b.transactions) {\n+        CachedTransaction cachedTransaction(txBlob);\n+        if (!m_core.hasTransaction(cachedTransaction.getTransactionHash())) {\n+          logger(Logging::DEBUGGING) << \"Transaction \" << cachedTransaction.getTransactionHash()\n+                                     << \" not present, adding to pool\";\n+          if(!m_core.addTransactionToPool(txBlob)) {\n+            logger(Logging::ERROR) << \"Transaction verification failed, dropping connection\";\n+            context.m_state = CryptoNoteConnectionContext::state_shutdown;\n+            return 1;\n+          }\n+        }\n+      }\n+    }\n+\n+    for (auto transactionHash: newBlockTemplate.transactionHashes) {\n+      BinaryArray transactionBlob;\n+      if (m_core.getPoolTransaction(transactionBlob, transactionHash)){\n+        have_txs.push_back(transactionBlob);\n+      }\n+      else {\n+        need_txs.push_back(transactionHash);\n+      }\n+    }\n+\n+    if (need_txs.empty()) {\n+      RawBlock newBlock;\n+      newBlock.block = arg.b.block;\n+      newBlock.transactions = have_txs;\n+\n+      auto result = m_core.addBlock(RawBlock{newBlock.block, newBlock.transactions});","path":"src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp","position":null,"original_position":130,"commit_id":"ec979f2d5496add806e495fc6a0e616539b7e690","original_commit_id":"173b4dcfb5723aa63f3faf361d4a7ff46651747a","user":{"login":"zpalmtree","id":22151537,"node_id":"MDQ6VXNlcjIyMTUxNTM3","avatar_url":"https://avatars0.githubusercontent.com/u/22151537?v=4","gravatar_id":"","url":"https://api.github.com/users/zpalmtree","html_url":"https://github.com/zpalmtree","followers_url":"https://api.github.com/users/zpalmtree/followers","following_url":"https://api.github.com/users/zpalmtree/following{/other_user}","gists_url":"https://api.github.com/users/zpalmtree/gists{/gist_id}","starred_url":"https://api.github.com/users/zpalmtree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zpalmtree/subscriptions","organizations_url":"https://api.github.com/users/zpalmtree/orgs","repos_url":"https://api.github.com/users/zpalmtree/repos","events_url":"https://api.github.com/users/zpalmtree/events{/privacy}","received_events_url":"https://api.github.com/users/zpalmtree/received_events","type":"User","site_admin":false},"body":"Oh, it's because it's taking an rvalue, I think. Do `auto result = m_core.addBlock(std::move(newBlock));` Alternatively, you could do `auto result = m_core.addBlock(RawBlock{arg.b.block, have_txs})`; (Personally I would prefer using an explicit ctor, but I assume it doesn't have one if brace initialization works)","created_at":"2018-12-03T16:10:22Z","updated_at":"2018-12-03T16:10:23Z","html_url":"https://github.com/turtlecoin/turtlecoin/pull/623#discussion_r238331936","pull_request_url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/comments/238331936"},"html":{"href":"https://github.com/turtlecoin/turtlecoin/pull/623#discussion_r238331936"},"pull_request":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623"}},"in_reply_to_id":238156229},"pull_request":{"url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623","id":235212267,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MjEyMjY3","html_url":"https://github.com/turtlecoin/turtlecoin/pull/623","diff_url":"https://github.com/turtlecoin/turtlecoin/pull/623.diff","patch_url":"https://github.com/turtlecoin/turtlecoin/pull/623.patch","issue_url":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/623","number":623,"state":"open","locked":false,"title":"Lite blocks","user":{"login":"rashedmyt","id":25506588,"node_id":"MDQ6VXNlcjI1NTA2NTg4","avatar_url":"https://avatars1.githubusercontent.com/u/25506588?v=4","gravatar_id":"","url":"https://api.github.com/users/rashedmyt","html_url":"https://github.com/rashedmyt","followers_url":"https://api.github.com/users/rashedmyt/followers","following_url":"https://api.github.com/users/rashedmyt/following{/other_user}","gists_url":"https://api.github.com/users/rashedmyt/gists{/gist_id}","starred_url":"https://api.github.com/users/rashedmyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashedmyt/subscriptions","organizations_url":"https://api.github.com/users/rashedmyt/orgs","repos_url":"https://api.github.com/users/rashedmyt/repos","events_url":"https://api.github.com/users/rashedmyt/events{/privacy}","received_events_url":"https://api.github.com/users/rashedmyt/received_events","type":"User","site_admin":false},"body":"Testnet required","created_at":"2018-12-01T19:19:21Z","updated_at":"2018-12-03T16:10:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4017189070e117f6beef27375019d29096d9c20","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623/commits","review_comments_url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623/comments","review_comment_url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/623/comments","statuses_url":"https://api.github.com/repos/turtlecoin/turtlecoin/statuses/ec979f2d5496add806e495fc6a0e616539b7e690","head":{"label":"rashedmyt:lite-blocks","ref":"lite-blocks","sha":"ec979f2d5496add806e495fc6a0e616539b7e690","user":{"login":"rashedmyt","id":25506588,"node_id":"MDQ6VXNlcjI1NTA2NTg4","avatar_url":"https://avatars1.githubusercontent.com/u/25506588?v=4","gravatar_id":"","url":"https://api.github.com/users/rashedmyt","html_url":"https://github.com/rashedmyt","followers_url":"https://api.github.com/users/rashedmyt/followers","following_url":"https://api.github.com/users/rashedmyt/following{/other_user}","gists_url":"https://api.github.com/users/rashedmyt/gists{/gist_id}","starred_url":"https://api.github.com/users/rashedmyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashedmyt/subscriptions","organizations_url":"https://api.github.com/users/rashedmyt/orgs","repos_url":"https://api.github.com/users/rashedmyt/repos","events_url":"https://api.github.com/users/rashedmyt/events{/privacy}","received_events_url":"https://api.github.com/users/rashedmyt/received_events","type":"User","site_admin":false},"repo":{"id":140940378,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA5NDAzNzg=","name":"turtlecoin","full_name":"rashedmyt/turtlecoin","private":false,"owner":{"login":"rashedmyt","id":25506588,"node_id":"MDQ6VXNlcjI1NTA2NTg4","avatar_url":"https://avatars1.githubusercontent.com/u/25506588?v=4","gravatar_id":"","url":"https://api.github.com/users/rashedmyt","html_url":"https://github.com/rashedmyt","followers_url":"https://api.github.com/users/rashedmyt/followers","following_url":"https://api.github.com/users/rashedmyt/following{/other_user}","gists_url":"https://api.github.com/users/rashedmyt/gists{/gist_id}","starred_url":"https://api.github.com/users/rashedmyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashedmyt/subscriptions","organizations_url":"https://api.github.com/users/rashedmyt/orgs","repos_url":"https://api.github.com/users/rashedmyt/repos","events_url":"https://api.github.com/users/rashedmyt/events{/privacy}","received_events_url":"https://api.github.com/users/rashedmyt/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rashedmyt/turtlecoin","description":"TurtleCoin is a private, fast, and easy way to send money to friends and businesses!","fork":true,"url":"https://api.github.com/repos/rashedmyt/turtlecoin","forks_url":"https://api.github.com/repos/rashedmyt/turtlecoin/forks","keys_url":"https://api.github.com/repos/rashedmyt/turtlecoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rashedmyt/turtlecoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rashedmyt/turtlecoin/teams","hooks_url":"https://api.github.com/repos/rashedmyt/turtlecoin/hooks","issue_events_url":"https://api.github.com/repos/rashedmyt/turtlecoin/issues/events{/number}","events_url":"https://api.github.com/repos/rashedmyt/turtlecoin/events","assignees_url":"https://api.github.com/repos/rashedmyt/turtlecoin/assignees{/user}","branches_url":"https://api.github.com/repos/rashedmyt/turtlecoin/branches{/branch}","tags_url":"https://api.github.com/repos/rashedmyt/turtlecoin/tags","blobs_url":"https://api.github.com/repos/rashedmyt/turtlecoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rashedmyt/turtlecoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rashedmyt/turtlecoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/rashedmyt/turtlecoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rashedmyt/turtlecoin/statuses/{sha}","languages_url":"https://api.github.com/repos/rashedmyt/turtlecoin/languages","stargazers_url":"https://api.github.com/repos/rashedmyt/turtlecoin/stargazers","contributors_url":"https://api.github.com/repos/rashedmyt/turtlecoin/contributors","subscribers_url":"https://api.github.com/repos/rashedmyt/turtlecoin/subscribers","subscription_url":"https://api.github.com/repos/rashedmyt/turtlecoin/subscription","commits_url":"https://api.github.com/repos/rashedmyt/turtlecoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/rashedmyt/turtlecoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/rashedmyt/turtlecoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/rashedmyt/turtlecoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/rashedmyt/turtlecoin/contents/{+path}","compare_url":"https://api.github.com/repos/rashedmyt/turtlecoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rashedmyt/turtlecoin/merges","archive_url":"https://api.github.com/repos/rashedmyt/turtlecoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rashedmyt/turtlecoin/downloads","issues_url":"https://api.github.com/repos/rashedmyt/turtlecoin/issues{/number}","pulls_url":"https://api.github.com/repos/rashedmyt/turtlecoin/pulls{/number}","milestones_url":"https://api.github.com/repos/rashedmyt/turtlecoin/milestones{/number}","notifications_url":"https://api.github.com/repos/rashedmyt/turtlecoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rashedmyt/turtlecoin/labels{/name}","releases_url":"https://api.github.com/repos/rashedmyt/turtlecoin/releases{/id}","deployments_url":"https://api.github.com/repos/rashedmyt/turtlecoin/deployments","created_at":"2018-07-14T11:24:41Z","updated_at":"2018-11-07T14:22:40Z","pushed_at":"2018-12-03T15:21:30Z","git_url":"git://github.com/rashedmyt/turtlecoin.git","ssh_url":"git@github.com:rashedmyt/turtlecoin.git","clone_url":"https://github.com/rashedmyt/turtlecoin.git","svn_url":"https://github.com/rashedmyt/turtlecoin","homepage":"https://turtlecoin.lol","size":31047,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"turtlecoin:development","ref":"development","sha":"c3658c4eea070d8188bbafcbc7ad1a7332f7db7d","user":{"login":"turtlecoin","id":34389551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Mzg5NTUx","avatar_url":"https://avatars2.githubusercontent.com/u/34389551?v=4","gravatar_id":"","url":"https://api.github.com/users/turtlecoin","html_url":"https://github.com/turtlecoin","followers_url":"https://api.github.com/users/turtlecoin/followers","following_url":"https://api.github.com/users/turtlecoin/following{/other_user}","gists_url":"https://api.github.com/users/turtlecoin/gists{/gist_id}","starred_url":"https://api.github.com/users/turtlecoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtlecoin/subscriptions","organizations_url":"https://api.github.com/users/turtlecoin/orgs","repos_url":"https://api.github.com/users/turtlecoin/repos","events_url":"https://api.github.com/users/turtlecoin/events{/privacy}","received_events_url":"https://api.github.com/users/turtlecoin/received_events","type":"Organization","site_admin":false},"repo":{"id":116604726,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY2MDQ3MjY=","name":"turtlecoin","full_name":"turtlecoin/turtlecoin","private":false,"owner":{"login":"turtlecoin","id":34389551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Mzg5NTUx","avatar_url":"https://avatars2.githubusercontent.com/u/34389551?v=4","gravatar_id":"","url":"https://api.github.com/users/turtlecoin","html_url":"https://github.com/turtlecoin","followers_url":"https://api.github.com/users/turtlecoin/followers","following_url":"https://api.github.com/users/turtlecoin/following{/other_user}","gists_url":"https://api.github.com/users/turtlecoin/gists{/gist_id}","starred_url":"https://api.github.com/users/turtlecoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtlecoin/subscriptions","organizations_url":"https://api.github.com/users/turtlecoin/orgs","repos_url":"https://api.github.com/users/turtlecoin/repos","events_url":"https://api.github.com/users/turtlecoin/events{/privacy}","received_events_url":"https://api.github.com/users/turtlecoin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/turtlecoin/turtlecoin","description":"TurtleCoin is a private, fast, and easy way to send money to friends and businesses!","fork":false,"url":"https://api.github.com/repos/turtlecoin/turtlecoin","forks_url":"https://api.github.com/repos/turtlecoin/turtlecoin/forks","keys_url":"https://api.github.com/repos/turtlecoin/turtlecoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/turtlecoin/turtlecoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/turtlecoin/turtlecoin/teams","hooks_url":"https://api.github.com/repos/turtlecoin/turtlecoin/hooks","issue_events_url":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/events{/number}","events_url":"https://api.github.com/repos/turtlecoin/turtlecoin/events","assignees_url":"https://api.github.com/repos/turtlecoin/turtlecoin/assignees{/user}","branches_url":"https://api.github.com/repos/turtlecoin/turtlecoin/branches{/branch}","tags_url":"https://api.github.com/repos/turtlecoin/turtlecoin/tags","blobs_url":"https://api.github.com/repos/turtlecoin/turtlecoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/turtlecoin/turtlecoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/turtlecoin/turtlecoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/turtlecoin/turtlecoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/turtlecoin/turtlecoin/statuses/{sha}","languages_url":"https://api.github.com/repos/turtlecoin/turtlecoin/languages","stargazers_url":"https://api.github.com/repos/turtlecoin/turtlecoin/stargazers","contributors_url":"https://api.github.com/repos/turtlecoin/turtlecoin/contributors","subscribers_url":"https://api.github.com/repos/turtlecoin/turtlecoin/subscribers","subscription_url":"https://api.github.com/repos/turtlecoin/turtlecoin/subscription","commits_url":"https://api.github.com/repos/turtlecoin/turtlecoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/turtlecoin/turtlecoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/turtlecoin/turtlecoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/turtlecoin/turtlecoin/contents/{+path}","compare_url":"https://api.github.com/repos/turtlecoin/turtlecoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/turtlecoin/turtlecoin/merges","archive_url":"https://api.github.com/repos/turtlecoin/turtlecoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/turtlecoin/turtlecoin/downloads","issues_url":"https://api.github.com/repos/turtlecoin/turtlecoin/issues{/number}","pulls_url":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls{/number}","milestones_url":"https://api.github.com/repos/turtlecoin/turtlecoin/milestones{/number}","notifications_url":"https://api.github.com/repos/turtlecoin/turtlecoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/turtlecoin/turtlecoin/labels{/name}","releases_url":"https://api.github.com/repos/turtlecoin/turtlecoin/releases{/id}","deployments_url":"https://api.github.com/repos/turtlecoin/turtlecoin/deployments","created_at":"2018-01-07T22:39:35Z","updated_at":"2018-12-02T23:45:37Z","pushed_at":"2018-12-03T15:51:44Z","git_url":"git://github.com/turtlecoin/turtlecoin.git","ssh_url":"git@github.com:turtlecoin/turtlecoin.git","clone_url":"https://github.com/turtlecoin/turtlecoin.git","svn_url":"https://github.com/turtlecoin/turtlecoin","homepage":"https://turtlecoin.lol","size":31110,"stargazers_count":395,"watchers_count":395,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":308,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":308,"open_issues":6,"watchers":395,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623"},"html":{"href":"https://github.com/turtlecoin/turtlecoin/pull/623"},"issue":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/623"},"comments":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/issues/623/comments"},"review_comments":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623/comments"},"review_comment":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/pulls/623/commits"},"statuses":{"href":"https://api.github.com/repos/turtlecoin/turtlecoin/statuses/ec979f2d5496add806e495fc6a0e616539b7e690"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zpalmtree"}}