{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/41758998","id":41758998,"diff_hunk":"@@ -954,6 +954,17 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa\n \n         // Store transaction in memory\n         pool.addUnchecked(hash, entry, setAncestors, !IsInitialBlockDownload());\n+\n+        // trim mempool and check if tx was trimmed\n+        if (!fOverrideMempoolLimit) {\n+            int expired = pool.Expire(GetTime() - GetArg(\"-mempoolexpiry\", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);\n+            if (expired != 0)\n+                LogPrint(\"mempool\", \"Expired %i transactions from the memory pool\\n\", expired);\n+\n+            pool.TrimToSize(GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, ::minRelayTxFee);\n+            if (!mempool.exists(tx.GetHash()))","path":"src/main.cpp","position":71,"original_position":71,"commit_id":"abb36aa255e5ce93e25d8ee9cf17c5a2843833cc","original_commit_id":"abb36aa255e5ce93e25d8ee9cf17c5a2843833cc","user":{"login":"instagibbs","id":5767891,"avatar_url":"https://avatars.githubusercontent.com/u/5767891?v=3","gravatar_id":"","url":"https://api.github.com/users/instagibbs","html_url":"https://github.com/instagibbs","followers_url":"https://api.github.com/users/instagibbs/followers","following_url":"https://api.github.com/users/instagibbs/following{/other_user}","gists_url":"https://api.github.com/users/instagibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/instagibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instagibbs/subscriptions","organizations_url":"https://api.github.com/users/instagibbs/orgs","repos_url":"https://api.github.com/users/instagibbs/repos","events_url":"https://api.github.com/users/instagibbs/events{/privacy}","received_events_url":"https://api.github.com/users/instagibbs/received_events","type":"User","site_admin":false},"body":"there a reason why it's not pool.exists rather than mempool?","created_at":"2015-10-12T14:04:30Z","updated_at":"2015-10-12T14:04:30Z","html_url":"https://github.com/bitcoin/bitcoin/pull/6722#discussion_r41758998","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/41758998"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/6722#discussion_r41758998"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722","id":45973719,"html_url":"https://github.com/bitcoin/bitcoin/pull/6722","diff_url":"https://github.com/bitcoin/bitcoin/pull/6722.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/6722.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/6722","number":6722,"state":"open","locked":false,"title":"Limit mempool by throwing away the cheapest txn and setting min relay fee to it","user":{"login":"TheBlueMatt","id":649246,"avatar_url":"https://avatars.githubusercontent.com/u/649246?v=3","gravatar_id":"","url":"https://api.github.com/users/TheBlueMatt","html_url":"https://github.com/TheBlueMatt","followers_url":"https://api.github.com/users/TheBlueMatt/followers","following_url":"https://api.github.com/users/TheBlueMatt/following{/other_user}","gists_url":"https://api.github.com/users/TheBlueMatt/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBlueMatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBlueMatt/subscriptions","organizations_url":"https://api.github.com/users/TheBlueMatt/orgs","repos_url":"https://api.github.com/users/TheBlueMatt/repos","events_url":"https://api.github.com/users/TheBlueMatt/events{/privacy}","received_events_url":"https://api.github.com/users/TheBlueMatt/received_events","type":"User","site_admin":false},"body":"Tests forthcoming, but I felt bad I still hadnt pushed this.\r\nSee commitmsg for more details.","created_at":"2015-09-25T03:21:16Z","updated_at":"2015-10-12T14:04:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb5ee6f00b79c4aad1d5df177a31b3af4ff61a01","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/6722/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/abb36aa255e5ce93e25d8ee9cf17c5a2843833cc","head":{"label":"TheBlueMatt:mempoollimit","ref":"mempoollimit","sha":"abb36aa255e5ce93e25d8ee9cf17c5a2843833cc","user":{"login":"TheBlueMatt","id":649246,"avatar_url":"https://avatars.githubusercontent.com/u/649246?v=3","gravatar_id":"","url":"https://api.github.com/users/TheBlueMatt","html_url":"https://github.com/TheBlueMatt","followers_url":"https://api.github.com/users/TheBlueMatt/followers","following_url":"https://api.github.com/users/TheBlueMatt/following{/other_user}","gists_url":"https://api.github.com/users/TheBlueMatt/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBlueMatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBlueMatt/subscriptions","organizations_url":"https://api.github.com/users/TheBlueMatt/orgs","repos_url":"https://api.github.com/users/TheBlueMatt/repos","events_url":"https://api.github.com/users/TheBlueMatt/events{/privacy}","received_events_url":"https://api.github.com/users/TheBlueMatt/received_events","type":"User","site_admin":false},"repo":{"id":1443291,"name":"bitcoin","full_name":"TheBlueMatt/bitcoin","owner":{"login":"TheBlueMatt","id":649246,"avatar_url":"https://avatars.githubusercontent.com/u/649246?v=3","gravatar_id":"","url":"https://api.github.com/users/TheBlueMatt","html_url":"https://github.com/TheBlueMatt","followers_url":"https://api.github.com/users/TheBlueMatt/followers","following_url":"https://api.github.com/users/TheBlueMatt/following{/other_user}","gists_url":"https://api.github.com/users/TheBlueMatt/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBlueMatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBlueMatt/subscriptions","organizations_url":"https://api.github.com/users/TheBlueMatt/orgs","repos_url":"https://api.github.com/users/TheBlueMatt/repos","events_url":"https://api.github.com/users/TheBlueMatt/events{/privacy}","received_events_url":"https://api.github.com/users/TheBlueMatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheBlueMatt/bitcoin","description":"Bitcoin (dont fork from here, fork from bitcoin/bitcoin)","fork":true,"url":"https://api.github.com/repos/TheBlueMatt/bitcoin","forks_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/forks","keys_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/teams","hooks_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/events","assignees_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/tags","blobs_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/languages","stargazers_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/subscription","commits_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/merges","archive_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/downloads","issues_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/TheBlueMatt/bitcoin/releases{/id}","created_at":"2011-03-05T14:14:49Z","updated_at":"2014-12-20T05:39:10Z","pushed_at":"2015-10-11T02:42:48Z","git_url":"git://github.com/TheBlueMatt/bitcoin.git","ssh_url":"git@github.com:TheBlueMatt/bitcoin.git","clone_url":"https://github.com/TheBlueMatt/bitcoin.git","svn_url":"https://github.com/TheBlueMatt/bitcoin","homepage":"http://www.bitcoin.org/","size":54144,"stargazers_count":10,"watchers_count":10,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":10,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"d479311dba25d6a697a0c5bebbb1e913a0121b9f","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","created_at":"2010-12-19T15:16:43Z","updated_at":"2015-10-12T13:39:02Z","pushed_at":"2015-10-11T23:51:10Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":138413,"stargazers_count":7626,"watchers_count":7626,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5264,"mirror_url":null,"open_issues_count":447,"forks":5264,"open_issues":447,"watchers":7626,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/6722"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/6722"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/6722/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/6722/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/abb36aa255e5ce93e25d8ee9cf17c5a2843833cc"}}}}