{"action":"created","comment":{"url":"https://api.github.com/repos/btcboost/copernicus/pulls/comments/172004487","pull_request_review_id":100962535,"id":172004487,"diff_hunk":"@@ -2805,7 +2827,50 @@ func IsCurrentForFeeEstimation() bool {\n func CheckInputsFromMempoolAndCache(tx *model.Tx, state *model.ValidationState, cache *utxo.CoinsViewCache,\n \tmpool *mempool.Mempool, flags uint32, cacheSigStore bool, txData *model.PrecomputedTransactionData) bool {\n \n-\treturn true\n+\t// todo AssertLockHeld(cs_main)\n+\t// pool.cs should be locked already, but go ahead and re-take the lock here\n+\t// to enforce that mempool doesn't change between when we check the view and\n+\t// when we actually call through to CheckInputs\n+\tmpool.Mtx.Lock()\n+\tdefer mpool.Mtx.Unlock()\n+\n+\tif tx.IsCoinBase() {\n+\t\tpanic(\"critical error\")\n+\t}\n+\tfor _, txin := range tx.Ins {\n+\t\tcoin := cache.AccessCoin(txin.PreviousOutPoint)\n+\n+\t\t// At this point we haven't actually checked if the coins are all\n+\t\t// available (or shouldn't assume we have, since CheckInputs does). So\n+\t\t// we just return failure if the inputs are not available here, and then\n+\t\t// only have to check equivalence for available inputs.\n+\t\tif coin.IsSpent() {\n+\t\t\treturn false\n+\t\t}\n+\n+\t\ttxFrom := mpool.Get(&txin.PreviousOutPoint.Hash)\n+\t\tif txFrom != nil {\n+\t\t\tif txFrom.TxHash() != txin.PreviousOutPoint.Hash {\n+\t\t\t\tpanic(\"critical error\")\n+\t\t\t}\n+\t\t\tif len(txFrom.Outs) <= int(txin.PreviousOutPoint.Index) {\n+\t\t\t\tpanic(\"critical error\")\n+\t\t\t}\n+\t\t\tif txFrom.Outs[txin.PreviousOutPoint.Index] != coin.TxOut {\n+\t\t\t\tpanic(\"critical error\")\n+\t\t\t}\n+\t\t} else {\n+\t\t\tcoinFromDisk := gcoinsTip.AccessCoin(txin.PreviousOutPoint)\n+\t\t\tif coinFromDisk.IsSpent() {\n+\t\t\t\tpanic(\"critical error \")\n+\t\t\t}\n+\t\t\tif coinFromDisk.TxOut.IsEqual(coin.TxOut) {","path":"blockchain/Validation.go","position":107,"original_position":107,"commit_id":"f37ac8cf6ec0381ddf1b5fe2685532cef3abf5e6","original_commit_id":"f37ac8cf6ec0381ddf1b5fe2685532cef3abf5e6","user":{"login":"ludete","id":23181804,"avatar_url":"https://avatars1.githubusercontent.com/u/23181804?v=4","gravatar_id":"","url":"https://api.github.com/users/ludete","html_url":"https://github.com/ludete","followers_url":"https://api.github.com/users/ludete/followers","following_url":"https://api.github.com/users/ludete/following{/other_user}","gists_url":"https://api.github.com/users/ludete/gists{/gist_id}","starred_url":"https://api.github.com/users/ludete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ludete/subscriptions","organizations_url":"https://api.github.com/users/ludete/orgs","repos_url":"https://api.github.com/users/ludete/repos","events_url":"https://api.github.com/users/ludete/events{/privacy}","received_events_url":"https://api.github.com/users/ludete/received_events","type":"User","site_admin":false},"body":"error","created_at":"2018-03-03T03:17:35Z","updated_at":"2018-03-03T03:33:41Z","html_url":"https://github.com/btcboost/copernicus/pull/64#discussion_r172004487","pull_request_url":"https://api.github.com/repos/btcboost/copernicus/pulls/64","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/comments/172004487"},"html":{"href":"https://github.com/btcboost/copernicus/pull/64#discussion_r172004487"},"pull_request":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/btcboost/copernicus/pulls/64","id":172400561,"html_url":"https://github.com/btcboost/copernicus/pull/64","diff_url":"https://github.com/btcboost/copernicus/pull/64.diff","patch_url":"https://github.com/btcboost/copernicus/pull/64.patch","issue_url":"https://api.github.com/repos/btcboost/copernicus/issues/64","number":64,"state":"open","locked":false,"title":"validation check input","user":{"login":"qshuai","id":20664531,"avatar_url":"https://avatars1.githubusercontent.com/u/20664531?v=4","gravatar_id":"","url":"https://api.github.com/users/qshuai","html_url":"https://github.com/qshuai","followers_url":"https://api.github.com/users/qshuai/followers","following_url":"https://api.github.com/users/qshuai/following{/other_user}","gists_url":"https://api.github.com/users/qshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/qshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qshuai/subscriptions","organizations_url":"https://api.github.com/users/qshuai/orgs","repos_url":"https://api.github.com/users/qshuai/repos","events_url":"https://api.github.com/users/qshuai/events{/privacy}","received_events_url":"https://api.github.com/users/qshuai/received_events","type":"User","site_admin":false},"body":"PTAL","created_at":"2018-03-02T01:31:16Z","updated_at":"2018-03-03T03:33:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"046b63f58db8d3c181a460ee0746a7b24b2a83ea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/btcboost/copernicus/pulls/64/commits","review_comments_url":"https://api.github.com/repos/btcboost/copernicus/pulls/64/comments","review_comment_url":"https://api.github.com/repos/btcboost/copernicus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/btcboost/copernicus/issues/64/comments","statuses_url":"https://api.github.com/repos/btcboost/copernicus/statuses/f37ac8cf6ec0381ddf1b5fe2685532cef3abf5e6","head":{"label":"qshuai:master","ref":"master","sha":"f37ac8cf6ec0381ddf1b5fe2685532cef3abf5e6","user":{"login":"qshuai","id":20664531,"avatar_url":"https://avatars1.githubusercontent.com/u/20664531?v=4","gravatar_id":"","url":"https://api.github.com/users/qshuai","html_url":"https://github.com/qshuai","followers_url":"https://api.github.com/users/qshuai/followers","following_url":"https://api.github.com/users/qshuai/following{/other_user}","gists_url":"https://api.github.com/users/qshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/qshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qshuai/subscriptions","organizations_url":"https://api.github.com/users/qshuai/orgs","repos_url":"https://api.github.com/users/qshuai/repos","events_url":"https://api.github.com/users/qshuai/events{/privacy}","received_events_url":"https://api.github.com/users/qshuai/received_events","type":"User","site_admin":false},"repo":{"id":117132157,"name":"copernicus","full_name":"qshuai/copernicus","owner":{"login":"qshuai","id":20664531,"avatar_url":"https://avatars1.githubusercontent.com/u/20664531?v=4","gravatar_id":"","url":"https://api.github.com/users/qshuai","html_url":"https://github.com/qshuai","followers_url":"https://api.github.com/users/qshuai/followers","following_url":"https://api.github.com/users/qshuai/following{/other_user}","gists_url":"https://api.github.com/users/qshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/qshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qshuai/subscriptions","organizations_url":"https://api.github.com/users/qshuai/orgs","repos_url":"https://api.github.com/users/qshuai/repos","events_url":"https://api.github.com/users/qshuai/events{/privacy}","received_events_url":"https://api.github.com/users/qshuai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qshuai/copernicus","description":"Golang bitcoin library","fork":true,"url":"https://api.github.com/repos/qshuai/copernicus","forks_url":"https://api.github.com/repos/qshuai/copernicus/forks","keys_url":"https://api.github.com/repos/qshuai/copernicus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qshuai/copernicus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qshuai/copernicus/teams","hooks_url":"https://api.github.com/repos/qshuai/copernicus/hooks","issue_events_url":"https://api.github.com/repos/qshuai/copernicus/issues/events{/number}","events_url":"https://api.github.com/repos/qshuai/copernicus/events","assignees_url":"https://api.github.com/repos/qshuai/copernicus/assignees{/user}","branches_url":"https://api.github.com/repos/qshuai/copernicus/branches{/branch}","tags_url":"https://api.github.com/repos/qshuai/copernicus/tags","blobs_url":"https://api.github.com/repos/qshuai/copernicus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qshuai/copernicus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qshuai/copernicus/git/refs{/sha}","trees_url":"https://api.github.com/repos/qshuai/copernicus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qshuai/copernicus/statuses/{sha}","languages_url":"https://api.github.com/repos/qshuai/copernicus/languages","stargazers_url":"https://api.github.com/repos/qshuai/copernicus/stargazers","contributors_url":"https://api.github.com/repos/qshuai/copernicus/contributors","subscribers_url":"https://api.github.com/repos/qshuai/copernicus/subscribers","subscription_url":"https://api.github.com/repos/qshuai/copernicus/subscription","commits_url":"https://api.github.com/repos/qshuai/copernicus/commits{/sha}","git_commits_url":"https://api.github.com/repos/qshuai/copernicus/git/commits{/sha}","comments_url":"https://api.github.com/repos/qshuai/copernicus/comments{/number}","issue_comment_url":"https://api.github.com/repos/qshuai/copernicus/issues/comments{/number}","contents_url":"https://api.github.com/repos/qshuai/copernicus/contents/{+path}","compare_url":"https://api.github.com/repos/qshuai/copernicus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qshuai/copernicus/merges","archive_url":"https://api.github.com/repos/qshuai/copernicus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qshuai/copernicus/downloads","issues_url":"https://api.github.com/repos/qshuai/copernicus/issues{/number}","pulls_url":"https://api.github.com/repos/qshuai/copernicus/pulls{/number}","milestones_url":"https://api.github.com/repos/qshuai/copernicus/milestones{/number}","notifications_url":"https://api.github.com/repos/qshuai/copernicus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qshuai/copernicus/labels{/name}","releases_url":"https://api.github.com/repos/qshuai/copernicus/releases{/id}","deployments_url":"https://api.github.com/repos/qshuai/copernicus/deployments","created_at":"2018-01-11T17:41:00Z","updated_at":"2018-01-11T17:41:02Z","pushed_at":"2018-03-02T01:30:05Z","git_url":"git://github.com/qshuai/copernicus.git","ssh_url":"git@github.com:qshuai/copernicus.git","clone_url":"https://github.com/qshuai/copernicus.git","svn_url":"https://github.com/qshuai/copernicus","homepage":"https://www.copernicuscore.org","size":2360,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"btcboost:master","ref":"master","sha":"30c8bee538ba84ead0b1270adf69336b60df0542","user":{"login":"btcboost","id":30145714,"avatar_url":"https://avatars1.githubusercontent.com/u/30145714?v=4","gravatar_id":"","url":"https://api.github.com/users/btcboost","html_url":"https://github.com/btcboost","followers_url":"https://api.github.com/users/btcboost/followers","following_url":"https://api.github.com/users/btcboost/following{/other_user}","gists_url":"https://api.github.com/users/btcboost/gists{/gist_id}","starred_url":"https://api.github.com/users/btcboost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btcboost/subscriptions","organizations_url":"https://api.github.com/users/btcboost/orgs","repos_url":"https://api.github.com/users/btcboost/repos","events_url":"https://api.github.com/users/btcboost/events{/privacy}","received_events_url":"https://api.github.com/users/btcboost/received_events","type":"Organization","site_admin":false},"repo":{"id":97192000,"name":"copernicus","full_name":"btcboost/copernicus","owner":{"login":"btcboost","id":30145714,"avatar_url":"https://avatars1.githubusercontent.com/u/30145714?v=4","gravatar_id":"","url":"https://api.github.com/users/btcboost","html_url":"https://github.com/btcboost","followers_url":"https://api.github.com/users/btcboost/followers","following_url":"https://api.github.com/users/btcboost/following{/other_user}","gists_url":"https://api.github.com/users/btcboost/gists{/gist_id}","starred_url":"https://api.github.com/users/btcboost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btcboost/subscriptions","organizations_url":"https://api.github.com/users/btcboost/orgs","repos_url":"https://api.github.com/users/btcboost/repos","events_url":"https://api.github.com/users/btcboost/events{/privacy}","received_events_url":"https://api.github.com/users/btcboost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/btcboost/copernicus","description":"Golang bitcoin library","fork":false,"url":"https://api.github.com/repos/btcboost/copernicus","forks_url":"https://api.github.com/repos/btcboost/copernicus/forks","keys_url":"https://api.github.com/repos/btcboost/copernicus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btcboost/copernicus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btcboost/copernicus/teams","hooks_url":"https://api.github.com/repos/btcboost/copernicus/hooks","issue_events_url":"https://api.github.com/repos/btcboost/copernicus/issues/events{/number}","events_url":"https://api.github.com/repos/btcboost/copernicus/events","assignees_url":"https://api.github.com/repos/btcboost/copernicus/assignees{/user}","branches_url":"https://api.github.com/repos/btcboost/copernicus/branches{/branch}","tags_url":"https://api.github.com/repos/btcboost/copernicus/tags","blobs_url":"https://api.github.com/repos/btcboost/copernicus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btcboost/copernicus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btcboost/copernicus/git/refs{/sha}","trees_url":"https://api.github.com/repos/btcboost/copernicus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btcboost/copernicus/statuses/{sha}","languages_url":"https://api.github.com/repos/btcboost/copernicus/languages","stargazers_url":"https://api.github.com/repos/btcboost/copernicus/stargazers","contributors_url":"https://api.github.com/repos/btcboost/copernicus/contributors","subscribers_url":"https://api.github.com/repos/btcboost/copernicus/subscribers","subscription_url":"https://api.github.com/repos/btcboost/copernicus/subscription","commits_url":"https://api.github.com/repos/btcboost/copernicus/commits{/sha}","git_commits_url":"https://api.github.com/repos/btcboost/copernicus/git/commits{/sha}","comments_url":"https://api.github.com/repos/btcboost/copernicus/comments{/number}","issue_comment_url":"https://api.github.com/repos/btcboost/copernicus/issues/comments{/number}","contents_url":"https://api.github.com/repos/btcboost/copernicus/contents/{+path}","compare_url":"https://api.github.com/repos/btcboost/copernicus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btcboost/copernicus/merges","archive_url":"https://api.github.com/repos/btcboost/copernicus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btcboost/copernicus/downloads","issues_url":"https://api.github.com/repos/btcboost/copernicus/issues{/number}","pulls_url":"https://api.github.com/repos/btcboost/copernicus/pulls{/number}","milestones_url":"https://api.github.com/repos/btcboost/copernicus/milestones{/number}","notifications_url":"https://api.github.com/repos/btcboost/copernicus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btcboost/copernicus/labels{/name}","releases_url":"https://api.github.com/repos/btcboost/copernicus/releases{/id}","deployments_url":"https://api.github.com/repos/btcboost/copernicus/deployments","created_at":"2017-07-14T04:10:42Z","updated_at":"2018-02-07T06:50:42Z","pushed_at":"2018-03-02T10:41:09Z","git_url":"git://github.com/btcboost/copernicus.git","ssh_url":"git@github.com:btcboost/copernicus.git","clone_url":"https://github.com/btcboost/copernicus.git","svn_url":"https://github.com/btcboost/copernicus","homepage":"https://www.copernicuscore.org","size":2300,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":8,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/64"},"html":{"href":"https://github.com/btcboost/copernicus/pull/64"},"issue":{"href":"https://api.github.com/repos/btcboost/copernicus/issues/64"},"comments":{"href":"https://api.github.com/repos/btcboost/copernicus/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/btcboost/copernicus/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/btcboost/copernicus/statuses/f37ac8cf6ec0381ddf1b5fe2685532cef3abf5e6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ludete"}}