{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/rippled/pulls/comments/74867930","id":74867930,"diff_hunk":"@@ -249,7 +249,25 @@ PathRequests::makeLegacyPathRequest(\n         app_.getLedgerMaster().newPathRequest();\n     }\n \n-    return result.second;\n+    return std::move (result.second);\n+}\n+\n+Json::Value\n+PathRequests::doLegacyPathRequest (\n+        Resource::Consumer& consumer,\n+        std::shared_ptr<ReadView const> const& inLedger,\n+        Json::Value const& request)\n+{\n+    auto cache = std::make_shared<RippleLineCache> (inLedger);\n+\n+    auto dummyCompletion = []() { ; };\n+    auto req = std::make_shared<PathRequest> (app_, std::move (dummyCompletion),\n+        consumer, ++mLastIdentifier, *this, mJournal);\n+\n+    auto result = req->doCreate (cache, request);\n+    if (result.first)\n+        result.second = req->doUpdate (cache, false);","path":"src/ripple/app/paths/PathRequests.cpp","position":31,"original_position":31,"commit_id":"386efa5356fbcff06873327c81e023e44d662e72","original_commit_id":"386efa5356fbcff06873327c81e023e44d662e72","user":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"body":"It's possible that we'll call `doUpdate` twice (the first time inside `doCreate` as a fast update, ignoring the result) and then here, as a slow update, saving the result. Is that the intention?","created_at":"2016-08-16T02:24:39Z","updated_at":"2016-08-16T02:24:39Z","html_url":"https://github.com/ripple/rippled/pull/1815#discussion_r74867930","pull_request_url":"https://api.github.com/repos/ripple/rippled/pulls/1815","_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments/74867930"},"html":{"href":"https://github.com/ripple/rippled/pull/1815#discussion_r74867930"},"pull_request":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1815"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/rippled/pulls/1815","id":81351329,"html_url":"https://github.com/ripple/rippled/pull/1815","diff_url":"https://github.com/ripple/rippled/pull/1815.diff","patch_url":"https://github.com/ripple/rippled/pull/1815.patch","issue_url":"https://api.github.com/repos/ripple/rippled/issues/1815","number":1815,"state":"open","locked":false,"title":"Remove old-style pathfinding code","user":{"login":"JoelKatz","id":877549,"avatar_url":"https://avatars.githubusercontent.com/u/877549?v=3","gravatar_id":"","url":"https://api.github.com/users/JoelKatz","html_url":"https://github.com/JoelKatz","followers_url":"https://api.github.com/users/JoelKatz/followers","following_url":"https://api.github.com/users/JoelKatz/following{/other_user}","gists_url":"https://api.github.com/users/JoelKatz/gists{/gist_id}","starred_url":"https://api.github.com/users/JoelKatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoelKatz/subscriptions","organizations_url":"https://api.github.com/users/JoelKatz/orgs","repos_url":"https://api.github.com/users/JoelKatz/repos","events_url":"https://api.github.com/users/JoelKatz/events{/privacy}","received_events_url":"https://api.github.com/users/JoelKatz/received_events","type":"User","site_admin":false},"body":"All cases that still used the old RPF code now use new-style pathfinding. This includes unit tests, RPF requests with a ledger specified, and RPF requests in standalone mode.\r\n\r\nRequests that used to use the `ripplePathFind` function (which had its own complex logic to call pathfinding and ripple calc functions) now asks the `PathRequests` singleton to do the work. It uses substantially the same logic is used to use for old-style requests, except that it does the work directly and immediately when called, returning when the request is complete. This allows it to support specifying a ledger and working without a functioning thread pool.\r\n\r\nThe change to `Consumer` is needed because the path finding code charges the consumer and the unit test code provides an unplumbed one. This used to cause crashes. Now charging an unconnected `Consumer` does nothing.\r\n\r\nSome of the unit tests may now be redundant, but I left them all in. The unit tests that used to call `ripplePathFind` directly now use the RPC interface to call ripple_path_find and use the new logic. Unit tests that used to check ripple_path_find through the RPC interface still do.\r\n\r\nThe one wart in this is that `PathRequest` uses the presence or absence of a completion handler to choose whether to use \"ripple_path_find\" or \"path_find semantics\". Since we need \"ripple_path_find\" semantics, we have to set a completion handler even though we don't need one.\r\n\r\nI tried using a separate flag to control this, and it was way worse because it either required an extra `PathRequest` constructor (and those are heavy, plus wasn't easy to understand) or ugliness in the member functions. I guess I could still unify them into one constructor with `optional`'s as parameters, but then knowing which combination of parameters get what behavior will be ugly. So I think it's best as is.","created_at":"2016-08-15T18:15:41Z","updated_at":"2016-08-16T02:24:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a49bb63b9b5e3f0032f250cb47d4b8f283971ab4","assignee":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"assignees":[{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ripple/rippled/pulls/1815/commits","review_comments_url":"https://api.github.com/repos/ripple/rippled/pulls/1815/comments","review_comment_url":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/rippled/issues/1815/comments","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/386efa5356fbcff06873327c81e023e44d662e72","head":{"label":"ripple:ds_pf","ref":"ds_pf","sha":"386efa5356fbcff06873327c81e023e44d662e72","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":2724167,"name":"rippled","full_name":"ripple/rippled","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/rippled","description":"Ripple peer-to-peer network daemon","fork":false,"url":"https://api.github.com/repos/ripple/rippled","forks_url":"https://api.github.com/repos/ripple/rippled/forks","keys_url":"https://api.github.com/repos/ripple/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/rippled/teams","hooks_url":"https://api.github.com/repos/ripple/rippled/hooks","issue_events_url":"https://api.github.com/repos/ripple/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/rippled/events","assignees_url":"https://api.github.com/repos/ripple/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/rippled/tags","blobs_url":"https://api.github.com/repos/ripple/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/rippled/languages","stargazers_url":"https://api.github.com/repos/ripple/rippled/stargazers","contributors_url":"https://api.github.com/repos/ripple/rippled/contributors","subscribers_url":"https://api.github.com/repos/ripple/rippled/subscribers","subscription_url":"https://api.github.com/repos/ripple/rippled/subscription","commits_url":"https://api.github.com/repos/ripple/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/rippled/merges","archive_url":"https://api.github.com/repos/ripple/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/rippled/downloads","issues_url":"https://api.github.com/repos/ripple/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/rippled/labels{/name}","releases_url":"https://api.github.com/repos/ripple/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/ripple/rippled/deployments","created_at":"2011-11-07T04:40:15Z","updated_at":"2016-08-15T13:28:26Z","pushed_at":"2016-08-16T02:09:40Z","git_url":"git://github.com/ripple/rippled.git","ssh_url":"git@github.com:ripple/rippled.git","clone_url":"https://github.com/ripple/rippled.git","svn_url":"https://github.com/ripple/rippled","homepage":"https://ripple.com","size":113185,"stargazers_count":1123,"watchers_count":1123,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":116,"forks":339,"open_issues":116,"watchers":1123,"default_branch":"develop"}},"base":{"label":"ripple:develop","ref":"develop","sha":"d51a2785ee40dbda98a12bf1c1837b72e5084026","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":2724167,"name":"rippled","full_name":"ripple/rippled","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/rippled","description":"Ripple peer-to-peer network daemon","fork":false,"url":"https://api.github.com/repos/ripple/rippled","forks_url":"https://api.github.com/repos/ripple/rippled/forks","keys_url":"https://api.github.com/repos/ripple/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/rippled/teams","hooks_url":"https://api.github.com/repos/ripple/rippled/hooks","issue_events_url":"https://api.github.com/repos/ripple/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/rippled/events","assignees_url":"https://api.github.com/repos/ripple/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/rippled/tags","blobs_url":"https://api.github.com/repos/ripple/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/rippled/languages","stargazers_url":"https://api.github.com/repos/ripple/rippled/stargazers","contributors_url":"https://api.github.com/repos/ripple/rippled/contributors","subscribers_url":"https://api.github.com/repos/ripple/rippled/subscribers","subscription_url":"https://api.github.com/repos/ripple/rippled/subscription","commits_url":"https://api.github.com/repos/ripple/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/rippled/merges","archive_url":"https://api.github.com/repos/ripple/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/rippled/downloads","issues_url":"https://api.github.com/repos/ripple/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/rippled/labels{/name}","releases_url":"https://api.github.com/repos/ripple/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/ripple/rippled/deployments","created_at":"2011-11-07T04:40:15Z","updated_at":"2016-08-15T13:28:26Z","pushed_at":"2016-08-16T02:09:40Z","git_url":"git://github.com/ripple/rippled.git","ssh_url":"git@github.com:ripple/rippled.git","clone_url":"https://github.com/ripple/rippled.git","svn_url":"https://github.com/ripple/rippled","homepage":"https://ripple.com","size":113185,"stargazers_count":1123,"watchers_count":1123,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":116,"forks":339,"open_issues":116,"watchers":1123,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1815"},"html":{"href":"https://github.com/ripple/rippled/pull/1815"},"issue":{"href":"https://api.github.com/repos/ripple/rippled/issues/1815"},"comments":{"href":"https://api.github.com/repos/ripple/rippled/issues/1815/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1815/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1815/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/rippled/statuses/386efa5356fbcff06873327c81e023e44d662e72"}}}}
{"actor":{"display_login":"nbougalis"}}