{"action":"created","comment":{"url":"https://api.github.com/repos/monero-project/monero/pulls/comments/243910653","pull_request_review_id":187793607,"id":243910653,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzkxMDY1Mw==","diff_hunk":"@@ -226,35 +226,55 @@ namespace cryptonote\n     std::vector<tx_extra_field> tx_extra_fields;\n     if (parse_tx_extra(tx.extra, tx_extra_fields))\n     {\n+      bool add_dummy_payment_id = true;\n       tx_extra_nonce extra_nonce;\n       if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))\n       {\n-        crypto::hash8 payment_id = null_hash8;\n-        if (get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))\n+        crypto::hash payment_id = null_hash;\n+        crypto::hash8 payment_id8 = null_hash8;\n+        if (get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))\n         {\n-          LOG_PRINT_L2(\"Encrypting payment id \" << payment_id);\n+          LOG_PRINT_L2(\"Encrypting payment id \" << payment_id8);\n           crypto::public_key view_key_pub = get_destination_view_key_pub(destinations, change_addr);\n           if (view_key_pub == null_pkey)\n           {\n             LOG_ERROR(\"Destinations have to have exactly one output to support encrypted payment ids\");\n             return false;\n           }\n \n-          if (!hwdev.encrypt_payment_id(payment_id, view_key_pub, tx_key))\n+          if (!hwdev.encrypt_payment_id(payment_id8, view_key_pub, tx_key))\n           {\n             LOG_ERROR(\"Failed to encrypt payment id\");\n             return false;\n           }\n \n           std::string extra_nonce;\n-          set_encrypted_payment_id_to_tx_extra_nonce(extra_nonce, payment_id);\n+          set_encrypted_payment_id_to_tx_extra_nonce(extra_nonce, payment_id8);\n           remove_field_from_tx_extra(tx.extra, typeid(tx_extra_nonce));\n           if (!add_extra_nonce_to_tx_extra(tx.extra, extra_nonce))\n           {\n             LOG_ERROR(\"Failed to add encrypted payment id to tx extra\");\n             return false;\n           }\n-          LOG_PRINT_L1(\"Encrypted payment ID: \" << payment_id);\n+          LOG_PRINT_L1(\"Encrypted payment ID: \" << payment_id8);\n+          add_dummy_payment_id = false;\n+        }\n+        else if (get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))\n+        {\n+          add_dummy_payment_id = false;\n+        }\n+      }\n+\n+      if (add_dummy_payment_id)\n+      {\n+        // if we have neither long not short payment id, add a dummy short one,\n+        // this should end up being the vast majority of txes as time goes on\n+        std::string extra_nonce;\n+        set_encrypted_payment_id_to_tx_extra_nonce(extra_nonce, crypto::rand<crypto::hash8>());","path":"src/cryptonote_core/cryptonote_tx_utils.cpp","position":54,"original_position":54,"commit_id":"b114c8260464a22cf20467f4803d075492cd250d","original_commit_id":"2ee625cacf91678d701caa29d7baee0f323138f2","user":{"login":"stoffu","id":26077532,"node_id":"MDQ6VXNlcjI2MDc3NTMy","avatar_url":"https://avatars1.githubusercontent.com/u/26077532?v=4","gravatar_id":"","url":"https://api.github.com/users/stoffu","html_url":"https://github.com/stoffu","followers_url":"https://api.github.com/users/stoffu/followers","following_url":"https://api.github.com/users/stoffu/following{/other_user}","gists_url":"https://api.github.com/users/stoffu/gists{/gist_id}","starred_url":"https://api.github.com/users/stoffu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoffu/subscriptions","organizations_url":"https://api.github.com/users/stoffu/orgs","repos_url":"https://api.github.com/users/stoffu/repos","events_url":"https://api.github.com/users/stoffu/events{/privacy}","received_events_url":"https://api.github.com/users/stoffu/received_events","type":"User","site_admin":false},"body":"That concern applies only to multi-destination transfers (i.e. 3 or more outputs including the change) where the use of payment ID doesn't make much sense (IIRC it's even disallowed by the wallet implementation). If it's a regular transfer to a single destination, the concern doesn't seem to apply and it seems to make sense to use the null payment ID.","created_at":"2018-12-25T13:54:10Z","updated_at":"2018-12-25T13:54:10Z","html_url":"https://github.com/monero-project/monero/pull/5008#discussion_r243910653","pull_request_url":"https://api.github.com/repos/monero-project/monero/pulls/5008","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/monero-project/monero/pulls/comments/243910653"},"html":{"href":"https://github.com/monero-project/monero/pull/5008#discussion_r243910653"},"pull_request":{"href":"https://api.github.com/repos/monero-project/monero/pulls/5008"}},"in_reply_to_id":243902510},"pull_request":{"url":"https://api.github.com/repos/monero-project/monero/pulls/5008","id":240685058,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNjg1MDU4","html_url":"https://github.com/monero-project/monero/pull/5008","diff_url":"https://github.com/monero-project/monero/pull/5008.diff","patch_url":"https://github.com/monero-project/monero/pull/5008.patch","issue_url":"https://api.github.com/repos/monero-project/monero/issues/5008","number":5008,"state":"open","locked":false,"title":"core: include a dummy encrypted payment id when no payment is used","user":{"login":"moneromooo-monero","id":8851073,"node_id":"MDQ6VXNlcjg4NTEwNzM=","avatar_url":"https://avatars3.githubusercontent.com/u/8851073?v=4","gravatar_id":"","url":"https://api.github.com/users/moneromooo-monero","html_url":"https://github.com/moneromooo-monero","followers_url":"https://api.github.com/users/moneromooo-monero/followers","following_url":"https://api.github.com/users/moneromooo-monero/following{/other_user}","gists_url":"https://api.github.com/users/moneromooo-monero/gists{/gist_id}","starred_url":"https://api.github.com/users/moneromooo-monero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneromooo-monero/subscriptions","organizations_url":"https://api.github.com/users/moneromooo-monero/orgs","repos_url":"https://api.github.com/users/moneromooo-monero/repos","events_url":"https://api.github.com/users/moneromooo-monero/events{/privacy}","received_events_url":"https://api.github.com/users/moneromooo-monero/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-23T14:35:16Z","updated_at":"2018-12-25T13:54:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71a5ea96e77c15659599fb328481f6ff5b3092ec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/monero-project/monero/pulls/5008/commits","review_comments_url":"https://api.github.com/repos/monero-project/monero/pulls/5008/comments","review_comment_url":"https://api.github.com/repos/monero-project/monero/pulls/comments{/number}","comments_url":"https://api.github.com/repos/monero-project/monero/issues/5008/comments","statuses_url":"https://api.github.com/repos/monero-project/monero/statuses/b114c8260464a22cf20467f4803d075492cd250d","head":{"label":"moneromooo-monero:dp","ref":"dp","sha":"b114c8260464a22cf20467f4803d075492cd250d","user":{"login":"moneromooo-monero","id":8851073,"node_id":"MDQ6VXNlcjg4NTEwNzM=","avatar_url":"https://avatars3.githubusercontent.com/u/8851073?v=4","gravatar_id":"","url":"https://api.github.com/users/moneromooo-monero","html_url":"https://github.com/moneromooo-monero","followers_url":"https://api.github.com/users/moneromooo-monero/followers","following_url":"https://api.github.com/users/moneromooo-monero/following{/other_user}","gists_url":"https://api.github.com/users/moneromooo-monero/gists{/gist_id}","starred_url":"https://api.github.com/users/moneromooo-monero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneromooo-monero/subscriptions","organizations_url":"https://api.github.com/users/moneromooo-monero/orgs","repos_url":"https://api.github.com/users/moneromooo-monero/repos","events_url":"https://api.github.com/users/moneromooo-monero/events{/privacy}","received_events_url":"https://api.github.com/users/moneromooo-monero/received_events","type":"User","site_admin":false},"repo":{"id":24294045,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI5NDA0NQ==","name":"bitmonero","full_name":"moneromooo-monero/bitmonero","private":false,"owner":{"login":"moneromooo-monero","id":8851073,"node_id":"MDQ6VXNlcjg4NTEwNzM=","avatar_url":"https://avatars3.githubusercontent.com/u/8851073?v=4","gravatar_id":"","url":"https://api.github.com/users/moneromooo-monero","html_url":"https://github.com/moneromooo-monero","followers_url":"https://api.github.com/users/moneromooo-monero/followers","following_url":"https://api.github.com/users/moneromooo-monero/following{/other_user}","gists_url":"https://api.github.com/users/moneromooo-monero/gists{/gist_id}","starred_url":"https://api.github.com/users/moneromooo-monero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneromooo-monero/subscriptions","organizations_url":"https://api.github.com/users/moneromooo-monero/orgs","repos_url":"https://api.github.com/users/moneromooo-monero/repos","events_url":"https://api.github.com/users/moneromooo-monero/events{/privacy}","received_events_url":"https://api.github.com/users/moneromooo-monero/received_events","type":"User","site_admin":false},"html_url":"https://github.com/moneromooo-monero/bitmonero","description":"Monero: the secure, private, untraceable cryptocurrency","fork":true,"url":"https://api.github.com/repos/moneromooo-monero/bitmonero","forks_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/forks","keys_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/teams","hooks_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/hooks","issue_events_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/issues/events{/number}","events_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/events","assignees_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/assignees{/user}","branches_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/branches{/branch}","tags_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/tags","blobs_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/statuses/{sha}","languages_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/languages","stargazers_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/stargazers","contributors_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/contributors","subscribers_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/subscribers","subscription_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/subscription","commits_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/issues/comments{/number}","contents_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/contents/{+path}","compare_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/merges","archive_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/downloads","issues_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/issues{/number}","pulls_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/pulls{/number}","milestones_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/milestones{/number}","notifications_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/labels{/name}","releases_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/releases{/id}","deployments_url":"https://api.github.com/repos/moneromooo-monero/bitmonero/deployments","created_at":"2014-09-21T15:04:04Z","updated_at":"2018-09-13T05:45:36Z","pushed_at":"2018-12-25T12:55:28Z","git_url":"git://github.com/moneromooo-monero/bitmonero.git","ssh_url":"git@github.com:moneromooo-monero/bitmonero.git","clone_url":"https://github.com/moneromooo-monero/bitmonero.git","svn_url":"https://github.com/moneromooo-monero/bitmonero","homepage":"https://getmonero.org","size":170594,"stargazers_count":17,"watchers_count":17,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4,"open_issues":0,"watchers":17,"default_branch":"master"}},"base":{"label":"monero-project:master","ref":"master","sha":"ed54ac8fdfe332c4ec6b9fd9331024d862ecad51","user":{"login":"monero-project","id":7450663,"node_id":"MDQ6VXNlcjc0NTA2NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/7450663?v=4","gravatar_id":"","url":"https://api.github.com/users/monero-project","html_url":"https://github.com/monero-project","followers_url":"https://api.github.com/users/monero-project/followers","following_url":"https://api.github.com/users/monero-project/following{/other_user}","gists_url":"https://api.github.com/users/monero-project/gists{/gist_id}","starred_url":"https://api.github.com/users/monero-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monero-project/subscriptions","organizations_url":"https://api.github.com/users/monero-project/orgs","repos_url":"https://api.github.com/users/monero-project/repos","events_url":"https://api.github.com/users/monero-project/events{/privacy}","received_events_url":"https://api.github.com/users/monero-project/received_events","type":"User","site_admin":false},"repo":{"id":19316619,"node_id":"MDEwOlJlcG9zaXRvcnkxOTMxNjYxOQ==","name":"monero","full_name":"monero-project/monero","private":false,"owner":{"login":"monero-project","id":7450663,"node_id":"MDQ6VXNlcjc0NTA2NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/7450663?v=4","gravatar_id":"","url":"https://api.github.com/users/monero-project","html_url":"https://github.com/monero-project","followers_url":"https://api.github.com/users/monero-project/followers","following_url":"https://api.github.com/users/monero-project/following{/other_user}","gists_url":"https://api.github.com/users/monero-project/gists{/gist_id}","starred_url":"https://api.github.com/users/monero-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monero-project/subscriptions","organizations_url":"https://api.github.com/users/monero-project/orgs","repos_url":"https://api.github.com/users/monero-project/repos","events_url":"https://api.github.com/users/monero-project/events{/privacy}","received_events_url":"https://api.github.com/users/monero-project/received_events","type":"User","site_admin":false},"html_url":"https://github.com/monero-project/monero","description":"Monero: the secure, private, untraceable cryptocurrency","fork":false,"url":"https://api.github.com/repos/monero-project/monero","forks_url":"https://api.github.com/repos/monero-project/monero/forks","keys_url":"https://api.github.com/repos/monero-project/monero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monero-project/monero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monero-project/monero/teams","hooks_url":"https://api.github.com/repos/monero-project/monero/hooks","issue_events_url":"https://api.github.com/repos/monero-project/monero/issues/events{/number}","events_url":"https://api.github.com/repos/monero-project/monero/events","assignees_url":"https://api.github.com/repos/monero-project/monero/assignees{/user}","branches_url":"https://api.github.com/repos/monero-project/monero/branches{/branch}","tags_url":"https://api.github.com/repos/monero-project/monero/tags","blobs_url":"https://api.github.com/repos/monero-project/monero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monero-project/monero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monero-project/monero/git/refs{/sha}","trees_url":"https://api.github.com/repos/monero-project/monero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monero-project/monero/statuses/{sha}","languages_url":"https://api.github.com/repos/monero-project/monero/languages","stargazers_url":"https://api.github.com/repos/monero-project/monero/stargazers","contributors_url":"https://api.github.com/repos/monero-project/monero/contributors","subscribers_url":"https://api.github.com/repos/monero-project/monero/subscribers","subscription_url":"https://api.github.com/repos/monero-project/monero/subscription","commits_url":"https://api.github.com/repos/monero-project/monero/commits{/sha}","git_commits_url":"https://api.github.com/repos/monero-project/monero/git/commits{/sha}","comments_url":"https://api.github.com/repos/monero-project/monero/comments{/number}","issue_comment_url":"https://api.github.com/repos/monero-project/monero/issues/comments{/number}","contents_url":"https://api.github.com/repos/monero-project/monero/contents/{+path}","compare_url":"https://api.github.com/repos/monero-project/monero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monero-project/monero/merges","archive_url":"https://api.github.com/repos/monero-project/monero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monero-project/monero/downloads","issues_url":"https://api.github.com/repos/monero-project/monero/issues{/number}","pulls_url":"https://api.github.com/repos/monero-project/monero/pulls{/number}","milestones_url":"https://api.github.com/repos/monero-project/monero/milestones{/number}","notifications_url":"https://api.github.com/repos/monero-project/monero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monero-project/monero/labels{/name}","releases_url":"https://api.github.com/repos/monero-project/monero/releases{/id}","deployments_url":"https://api.github.com/repos/monero-project/monero/deployments","created_at":"2014-04-30T14:38:28Z","updated_at":"2018-12-25T13:15:05Z","pushed_at":"2018-12-25T12:55:31Z","git_url":"git://github.com/monero-project/monero.git","ssh_url":"git@github.com:monero-project/monero.git","clone_url":"https://github.com/monero-project/monero.git","svn_url":"https://github.com/monero-project/monero","homepage":"https://getmonero.org","size":148629,"stargazers_count":3538,"watchers_count":3538,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1835,"mirror_url":null,"archived":false,"open_issues_count":303,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1835,"open_issues":303,"watchers":3538,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/monero-project/monero/pulls/5008"},"html":{"href":"https://github.com/monero-project/monero/pull/5008"},"issue":{"href":"https://api.github.com/repos/monero-project/monero/issues/5008"},"comments":{"href":"https://api.github.com/repos/monero-project/monero/issues/5008/comments"},"review_comments":{"href":"https://api.github.com/repos/monero-project/monero/pulls/5008/comments"},"review_comment":{"href":"https://api.github.com/repos/monero-project/monero/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/monero-project/monero/pulls/5008/commits"},"statuses":{"href":"https://api.github.com/repos/monero-project/monero/statuses/b114c8260464a22cf20467f4803d075492cd250d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stoffu"}}