{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/comments/26267697","id":26267697,"diff_hunk":"@@ -2146,12 +2250,42 @@ public boolean maybeCommitTx(Transaction tx) throws VerificationException {\n             // move any transactions that are now fully spent to the spent map so we can skip them when creating future\n             // spends.\n             updateForSpends(tx, false);\n-            // Add to the pending pool. It'll be moved out once we receive this transaction on the best chain.\n-            // This also registers txConfidenceListener so wallet listeners get informed.\n-            log.info(\"->pending: {}\", tx.getHashAsString());\n-            tx.getConfidence().setConfidenceType(ConfidenceType.PENDING);\n-            confidenceChanged.put(tx, TransactionConfidence.Listener.ChangeReason.TYPE);\n-            addWalletTransaction(Pool.PENDING, tx);\n+            \n+            Set<Transaction> doubleSpendPendingTxns = findDoubleSpendsAgainst(tx, pending);\n+            Set<Transaction> doubleSpendUnspentTxns = findDoubleSpendsAgainst(tx, unspent);\n+            Set<Transaction> doubleSpendSpentTxns = findDoubleSpendsAgainst(tx, spent);\n+            \n+            if (!doubleSpendUnspentTxns.isEmpty() || ","path":"core/src/main/java/org/bitcoinj/core/Wallet.java","position":244,"original_position":244,"commit_id":"22d5013f481a6d43e4cffc50b965ba3f701ce195","original_commit_id":"22d5013f481a6d43e4cffc50b965ba3f701ce195","user":{"login":"mikehearn","id":971089,"avatar_url":"https://avatars.githubusercontent.com/u/971089?v=3","gravatar_id":"","url":"https://api.github.com/users/mikehearn","html_url":"https://github.com/mikehearn","followers_url":"https://api.github.com/users/mikehearn/followers","following_url":"https://api.github.com/users/mikehearn/following{/other_user}","gists_url":"https://api.github.com/users/mikehearn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehearn/subscriptions","organizations_url":"https://api.github.com/users/mikehearn/orgs","repos_url":"https://api.github.com/users/mikehearn/repos","events_url":"https://api.github.com/users/mikehearn/events{/privacy}","received_events_url":"https://api.github.com/users/mikehearn/received_events","type":"User","site_admin":false},"body":"How can this case happen? The commit path checks that a tx isn't in the wallet already.","created_at":"2015-03-11T23:52:00Z","updated_at":"2015-03-11T23:52:00Z","html_url":"https://github.com/bitcoinj/bitcoinj/pull/331#discussion_r26267697","pull_request_url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331","_links":{"self":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/comments/26267697"},"html":{"href":"https://github.com/bitcoinj/bitcoinj/pull/331#discussion_r26267697"},"pull_request":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331","id":30995304,"html_url":"https://github.com/bitcoinj/bitcoinj/pull/331","diff_url":"https://github.com/bitcoinj/bitcoinj/pull/331.diff","patch_url":"https://github.com/bitcoinj/bitcoinj/pull/331.patch","issue_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/331","number":331,"state":"open","locked":false,"title":"Support double spend forwarding","user":{"login":"oscarguindzberg","id":1145132,"avatar_url":"https://avatars.githubusercontent.com/u/1145132?v=3","gravatar_id":"","url":"https://api.github.com/users/oscarguindzberg","html_url":"https://github.com/oscarguindzberg","followers_url":"https://api.github.com/users/oscarguindzberg/followers","following_url":"https://api.github.com/users/oscarguindzberg/following{/other_user}","gists_url":"https://api.github.com/users/oscarguindzberg/gists{/gist_id}","starred_url":"https://api.github.com/users/oscarguindzberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oscarguindzberg/subscriptions","organizations_url":"https://api.github.com/users/oscarguindzberg/orgs","repos_url":"https://api.github.com/users/oscarguindzberg/repos","events_url":"https://api.github.com/users/oscarguindzberg/events{/privacy}","received_events_url":"https://api.github.com/users/oscarguindzberg/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-11T23:22:41Z","updated_at":"2015-03-11T23:52:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3485c988ba439620ce887e5d23b47ff0e42993d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331/commits","review_comments_url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331/comments","review_comment_url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/331/comments","statuses_url":"https://api.github.com/repos/bitcoinj/bitcoinj/statuses/22d5013f481a6d43e4cffc50b965ba3f701ce195","head":{"label":"oscarguindzberg:forward-double-spends2","ref":"forward-double-spends2","sha":"22d5013f481a6d43e4cffc50b965ba3f701ce195","user":{"login":"oscarguindzberg","id":1145132,"avatar_url":"https://avatars.githubusercontent.com/u/1145132?v=3","gravatar_id":"","url":"https://api.github.com/users/oscarguindzberg","html_url":"https://github.com/oscarguindzberg","followers_url":"https://api.github.com/users/oscarguindzberg/followers","following_url":"https://api.github.com/users/oscarguindzberg/following{/other_user}","gists_url":"https://api.github.com/users/oscarguindzberg/gists{/gist_id}","starred_url":"https://api.github.com/users/oscarguindzberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oscarguindzberg/subscriptions","organizations_url":"https://api.github.com/users/oscarguindzberg/orgs","repos_url":"https://api.github.com/users/oscarguindzberg/repos","events_url":"https://api.github.com/users/oscarguindzberg/events{/privacy}","received_events_url":"https://api.github.com/users/oscarguindzberg/received_events","type":"User","site_admin":false},"repo":{"id":19839304,"name":"bitcoinj","full_name":"oscarguindzberg/bitcoinj","owner":{"login":"oscarguindzberg","id":1145132,"avatar_url":"https://avatars.githubusercontent.com/u/1145132?v=3","gravatar_id":"","url":"https://api.github.com/users/oscarguindzberg","html_url":"https://github.com/oscarguindzberg","followers_url":"https://api.github.com/users/oscarguindzberg/followers","following_url":"https://api.github.com/users/oscarguindzberg/following{/other_user}","gists_url":"https://api.github.com/users/oscarguindzberg/gists{/gist_id}","starred_url":"https://api.github.com/users/oscarguindzberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oscarguindzberg/subscriptions","organizations_url":"https://api.github.com/users/oscarguindzberg/orgs","repos_url":"https://api.github.com/users/oscarguindzberg/repos","events_url":"https://api.github.com/users/oscarguindzberg/events{/privacy}","received_events_url":"https://api.github.com/users/oscarguindzberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oscarguindzberg/bitcoinj","description":"A library for working with Bitcoin","fork":true,"url":"https://api.github.com/repos/oscarguindzberg/bitcoinj","forks_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/forks","keys_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/teams","hooks_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/hooks","issue_events_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/issues/events{/number}","events_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/events","assignees_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/assignees{/user}","branches_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/branches{/branch}","tags_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/tags","blobs_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/git/refs{/sha}","trees_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/statuses/{sha}","languages_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/languages","stargazers_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/stargazers","contributors_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/contributors","subscribers_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/subscribers","subscription_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/subscription","commits_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/commits{/sha}","git_commits_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/git/commits{/sha}","comments_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/comments{/number}","issue_comment_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/issues/comments{/number}","contents_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/contents/{+path}","compare_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/merges","archive_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/downloads","issues_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/issues{/number}","pulls_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/pulls{/number}","milestones_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/milestones{/number}","notifications_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/labels{/name}","releases_url":"https://api.github.com/repos/oscarguindzberg/bitcoinj/releases{/id}","created_at":"2014-05-16T00:09:32Z","updated_at":"2015-03-11T23:00:52Z","pushed_at":"2015-03-11T23:19:04Z","git_url":"git://github.com/oscarguindzberg/bitcoinj.git","ssh_url":"git@github.com:oscarguindzberg/bitcoinj.git","clone_url":"https://github.com/oscarguindzberg/bitcoinj.git","svn_url":"https://github.com/oscarguindzberg/bitcoinj","homepage":"http://www.bitcoinj.org","size":16017,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoinj:master","ref":"master","sha":"c4a49eeb85ab4df9967b13b96b0b891efd261778","user":{"login":"bitcoinj","id":5951625,"avatar_url":"https://avatars.githubusercontent.com/u/5951625?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinj","html_url":"https://github.com/bitcoinj","followers_url":"https://api.github.com/users/bitcoinj/followers","following_url":"https://api.github.com/users/bitcoinj/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinj/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinj/subscriptions","organizations_url":"https://api.github.com/users/bitcoinj/orgs","repos_url":"https://api.github.com/users/bitcoinj/repos","events_url":"https://api.github.com/users/bitcoinj/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinj/received_events","type":"Organization","site_admin":false},"repo":{"id":14514251,"name":"bitcoinj","full_name":"bitcoinj/bitcoinj","owner":{"login":"bitcoinj","id":5951625,"avatar_url":"https://avatars.githubusercontent.com/u/5951625?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinj","html_url":"https://github.com/bitcoinj","followers_url":"https://api.github.com/users/bitcoinj/followers","following_url":"https://api.github.com/users/bitcoinj/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinj/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinj/subscriptions","organizations_url":"https://api.github.com/users/bitcoinj/orgs","repos_url":"https://api.github.com/users/bitcoinj/repos","events_url":"https://api.github.com/users/bitcoinj/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoinj/bitcoinj","description":"A library for working with Bitcoin","fork":false,"url":"https://api.github.com/repos/bitcoinj/bitcoinj","forks_url":"https://api.github.com/repos/bitcoinj/bitcoinj/forks","keys_url":"https://api.github.com/repos/bitcoinj/bitcoinj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoinj/bitcoinj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoinj/bitcoinj/teams","hooks_url":"https://api.github.com/repos/bitcoinj/bitcoinj/hooks","issue_events_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoinj/bitcoinj/events","assignees_url":"https://api.github.com/repos/bitcoinj/bitcoinj/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoinj/bitcoinj/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoinj/bitcoinj/tags","blobs_url":"https://api.github.com/repos/bitcoinj/bitcoinj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoinj/bitcoinj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoinj/bitcoinj/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoinj/bitcoinj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoinj/bitcoinj/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoinj/bitcoinj/languages","stargazers_url":"https://api.github.com/repos/bitcoinj/bitcoinj/stargazers","contributors_url":"https://api.github.com/repos/bitcoinj/bitcoinj/contributors","subscribers_url":"https://api.github.com/repos/bitcoinj/bitcoinj/subscribers","subscription_url":"https://api.github.com/repos/bitcoinj/bitcoinj/subscription","commits_url":"https://api.github.com/repos/bitcoinj/bitcoinj/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoinj/bitcoinj/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoinj/bitcoinj/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoinj/bitcoinj/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoinj/bitcoinj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoinj/bitcoinj/merges","archive_url":"https://api.github.com/repos/bitcoinj/bitcoinj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoinj/bitcoinj/downloads","issues_url":"https://api.github.com/repos/bitcoinj/bitcoinj/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoinj/bitcoinj/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoinj/bitcoinj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoinj/bitcoinj/labels{/name}","releases_url":"https://api.github.com/repos/bitcoinj/bitcoinj/releases{/id}","created_at":"2013-11-19T04:33:23Z","updated_at":"2015-03-11T19:59:53Z","pushed_at":"2015-03-11T19:59:53Z","git_url":"git://github.com/bitcoinj/bitcoinj.git","ssh_url":"git@github.com:bitcoinj/bitcoinj.git","clone_url":"https://github.com/bitcoinj/bitcoinj.git","svn_url":"https://github.com/bitcoinj/bitcoinj","homepage":"http://www.bitcoinj.org","size":28430,"stargazers_count":347,"watchers_count":347,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":363,"mirror_url":null,"open_issues_count":15,"forks":363,"open_issues":15,"watchers":347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331"},"html":{"href":"https://github.com/bitcoinj/bitcoinj/pull/331"},"issue":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/331"},"comments":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/issues/331/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/pulls/331/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoinj/bitcoinj/statuses/22d5013f481a6d43e4cffc50b965ba3f701ce195"}}}}