payload: {"action":"created","comment":{"url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/comments/356149869","pull_request_review_id":329981982,"id":356149869,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NjE0OTg2OQ==","diff_hunk":"@@ -498,14 +510,26 @@ def sync_unspent(self):\n         our_unspent_list = [x for x in unspent_list if (\n             self.bci.is_address_labeled(x, wallet_name) or\n             self.bci.is_address_labeled(x, self.EXTERNAL_WALLET_LABEL))]\n-        for u in our_unspent_list:\n-            if not self.is_known_addr(u['address']):\n+        for utxo in our_unspent_list:\n+            if not self.is_known_addr(utxo['address']):\n                 continue\n-            self._add_unspent_utxo(u, current_blockheight)\n+            if \"height\" in utxo:\n+                height = utxo[\"height\"]\n+            else:\n+                height = None\n+                # wallet's utxo database needs to store an absolute rather\n+                # than relative height measure:\n+                confs = int(utxo['confirmations'])\n+                if confs < 0:\n+                    jlog.warning(\"Utxo not added, has a conflict: \" + str(utxo))\n+                    continue\n+                if confs >= 1:\n+                    height = current_blockheight - confs + 1\n+            self._add_unspent_txo(utxo, height)\n         et = time.time()\n         jlog.debug('bitcoind sync_unspent took ' + str((et - st)) + 'sec')\n \n-    def _add_unspent_utxo(self, utxo, current_blockheight):\n+    def _add_unspent_txo(self, utxo, height):","path":"jmclient/jmclient/wallet_service.py","position":122,"original_position":122,"commit_id":"ae7bd90ddfdea73d00471a3bb19724fdcbb93826","original_commit_id":"ae7bd90ddfdea73d00471a3bb19724fdcbb93826","user":{"login":"AdamISZ","id":4278257,"node_id":"MDQ6VXNlcjQyNzgyNTc=","avatar_url":"https://avatars2.githubusercontent.com/u/4278257?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamISZ","html_url":"https://github.com/AdamISZ","followers_url":"https://api.github.com/users/AdamISZ/followers","following_url":"https://api.github.com/users/AdamISZ/following{/other_user}","gists_url":"https://api.github.com/users/AdamISZ/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamISZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamISZ/subscriptions","organizations_url":"https://api.github.com/users/AdamISZ/orgs","repos_url":"https://api.github.com/users/AdamISZ/repos","events_url":"https://api.github.com/users/AdamISZ/events{/privacy}","received_events_url":"https://api.github.com/users/AdamISZ/received_events","type":"User","site_admin":false},"body":"Well I can't argue with this naming correction, lol","created_at":"2019-12-10T16:42:10Z","updated_at":"2019-12-10T16:42:10Z","html_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444#discussion_r356149869","pull_request_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/comments/356149869"},"html":{"href":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444#discussion_r356149869"},"pull_request":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444"}}},"pull_request":{"url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444","id":339316827,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM5MzE2ODI3","html_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444","diff_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444.diff","patch_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444.patch","issue_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/444","number":444,"state":"open","locked":false,"title":"Wallet no history sync","user":{"login":"chris-belcher","id":8398185,"node_id":"MDQ6VXNlcjgzOTgxODU=","avatar_url":"https://avatars2.githubusercontent.com/u/8398185?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-belcher","html_url":"https://github.com/chris-belcher","followers_url":"https://api.github.com/users/chris-belcher/followers","following_url":"https://api.github.com/users/chris-belcher/following{/other_user}","gists_url":"https://api.github.com/users/chris-belcher/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-belcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-belcher/subscriptions","organizations_url":"https://api.github.com/users/chris-belcher/orgs","repos_url":"https://api.github.com/users/chris-belcher/repos","events_url":"https://api.github.com/users/chris-belcher/events{/privacy}","received_events_url":"https://api.github.com/users/chris-belcher/received_events","type":"User","site_admin":false},"body":"No-history is a method for synchronizing a wallet by scanning the UTXO\r\nset. It can be useful for checking whether seed phrase backups have\r\nmoney on them before committing the time and effort required to\r\nrescanning the blockchain. No-history sync is compatible with pruning.\r\nThe sync method cannot tell which empty addresses have been used, so\r\ncannot guarentee avoidance of address reuse. For this reason no-history\r\nsync disables wallet address generation and can only be used with\r\nwallet-tool and for sending coinjoins without change addresses.\r\n\r\nThis PR can be easily tested by setting `blockchain_source = bitcoin-rpc-no-history`, importing a seed phrase to create a new wallet file (with `$ python3 wallet-tool.py recover`) then running `$ python3 wallet-tool.py --recoversync -g 500 newwalletfile.jmdat` and checking that all your money appears. Make sure to increase the gap limit to an appropriate value so that all the addresses which might have coin on them are scanned.","created_at":"2019-11-11T08:54:00Z","updated_at":"2019-12-10T16:42:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60f8febf0d1a63fa87db8314517c09ac7d003907","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444/commits","review_comments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444/comments","review_comment_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/444/comments","statuses_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/statuses/ae7bd90ddfdea73d00471a3bb19724fdcbb93826","head":{"label":"JoinMarket-Org:wallet-no-history-sync","ref":"wallet-no-history-sync","sha":"ae7bd90ddfdea73d00471a3bb19724fdcbb93826","user":{"login":"JoinMarket-Org","id":16105296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTA1Mjk2","avatar_url":"https://avatars3.githubusercontent.com/u/16105296?v=4","gravatar_id":"","url":"https://api.github.com/users/JoinMarket-Org","html_url":"https://github.com/JoinMarket-Org","followers_url":"https://api.github.com/users/JoinMarket-Org/followers","following_url":"https://api.github.com/users/JoinMarket-Org/following{/other_user}","gists_url":"https://api.github.com/users/JoinMarket-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/JoinMarket-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoinMarket-Org/subscriptions","organizations_url":"https://api.github.com/users/JoinMarket-Org/orgs","repos_url":"https://api.github.com/users/JoinMarket-Org/repos","events_url":"https://api.github.com/users/JoinMarket-Org/events{/privacy}","received_events_url":"https://api.github.com/users/JoinMarket-Org/received_events","type":"Organization","site_admin":false},"repo":{"id":74501389,"node_id":"MDEwOlJlcG9zaXRvcnk3NDUwMTM4OQ==","name":"joinmarket-clientserver","full_name":"JoinMarket-Org/joinmarket-clientserver","private":false,"owner":{"login":"JoinMarket-Org","id":16105296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTA1Mjk2","avatar_url":"https://avatars3.githubusercontent.com/u/16105296?v=4","gravatar_id":"","url":"https://api.github.com/users/JoinMarket-Org","html_url":"https://github.com/JoinMarket-Org","followers_url":"https://api.github.com/users/JoinMarket-Org/followers","following_url":"https://api.github.com/users/JoinMarket-Org/following{/other_user}","gists_url":"https://api.github.com/users/JoinMarket-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/JoinMarket-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoinMarket-Org/subscriptions","organizations_url":"https://api.github.com/users/JoinMarket-Org/orgs","repos_url":"https://api.github.com/users/JoinMarket-Org/repos","events_url":"https://api.github.com/users/JoinMarket-Org/events{/privacy}","received_events_url":"https://api.github.com/users/JoinMarket-Org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver","description":"Joinmarket refactored to separate client and backend operations","fork":false,"url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver","forks_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/forks","keys_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/teams","hooks_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/hooks","issue_events_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/events{/number}","events_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/events","assignees_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/assignees{/user}","branches_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/branches{/branch}","tags_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/tags","blobs_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/statuses/{sha}","languages_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/languages","stargazers_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/stargazers","contributors_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/contributors","subscribers_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/subscribers","subscription_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/subscription","commits_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/contents/{+path}","compare_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/merges","archive_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/downloads","issues_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues{/number}","pulls_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls{/number}","milestones_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/milestones{/number}","notifications_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/labels{/name}","releases_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/releases{/id}","deployments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/deployments","created_at":"2016-11-22T18:23:20Z","updated_at":"2019-12-10T11:55:14Z","pushed_at":"2019-12-10T12:25:11Z","git_url":"git://github.com/JoinMarket-Org/joinmarket-clientserver.git","ssh_url":"git@github.com:JoinMarket-Org/joinmarket-clientserver.git","clone_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver.git","svn_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver","homepage":null,"size":3948,"stargazers_count":140,"watchers_count":140,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":57,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":59,"open_issues":57,"watchers":140,"default_branch":"master"}},"base":{"label":"JoinMarket-Org:master","ref":"master","sha":"8f3275fc5d0b04e3bcaed7340dcf40a55d98752d","user":{"login":"JoinMarket-Org","id":16105296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTA1Mjk2","avatar_url":"https://avatars3.githubusercontent.com/u/16105296?v=4","gravatar_id":"","url":"https://api.github.com/users/JoinMarket-Org","html_url":"https://github.com/JoinMarket-Org","followers_url":"https://api.github.com/users/JoinMarket-Org/followers","following_url":"https://api.github.com/users/JoinMarket-Org/following{/other_user}","gists_url":"https://api.github.com/users/JoinMarket-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/JoinMarket-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoinMarket-Org/subscriptions","organizations_url":"https://api.github.com/users/JoinMarket-Org/orgs","repos_url":"https://api.github.com/users/JoinMarket-Org/repos","events_url":"https://api.github.com/users/JoinMarket-Org/events{/privacy}","received_events_url":"https://api.github.com/users/JoinMarket-Org/received_events","type":"Organization","site_admin":false},"repo":{"id":74501389,"node_id":"MDEwOlJlcG9zaXRvcnk3NDUwMTM4OQ==","name":"joinmarket-clientserver","full_name":"JoinMarket-Org/joinmarket-clientserver","private":false,"owner":{"login":"JoinMarket-Org","id":16105296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTA1Mjk2","avatar_url":"https://avatars3.githubusercontent.com/u/16105296?v=4","gravatar_id":"","url":"https://api.github.com/users/JoinMarket-Org","html_url":"https://github.com/JoinMarket-Org","followers_url":"https://api.github.com/users/JoinMarket-Org/followers","following_url":"https://api.github.com/users/JoinMarket-Org/following{/other_user}","gists_url":"https://api.github.com/users/JoinMarket-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/JoinMarket-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoinMarket-Org/subscriptions","organizations_url":"https://api.github.com/users/JoinMarket-Org/orgs","repos_url":"https://api.github.com/users/JoinMarket-Org/repos","events_url":"https://api.github.com/users/JoinMarket-Org/events{/privacy}","received_events_url":"https://api.github.com/users/JoinMarket-Org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver","description":"Joinmarket refactored to separate client and backend operations","fork":false,"url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver","forks_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/forks","keys_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/teams","hooks_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/hooks","issue_events_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/events{/number}","events_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/events","assignees_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/assignees{/user}","branches_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/branches{/branch}","tags_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/tags","blobs_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/statuses/{sha}","languages_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/languages","stargazers_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/stargazers","contributors_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/contributors","subscribers_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/subscribers","subscription_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/subscription","commits_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/contents/{+path}","compare_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/merges","archive_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/downloads","issues_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues{/number}","pulls_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls{/number}","milestones_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/milestones{/number}","notifications_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/labels{/name}","releases_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/releases{/id}","deployments_url":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/deployments","created_at":"2016-11-22T18:23:20Z","updated_at":"2019-12-10T11:55:14Z","pushed_at":"2019-12-10T12:25:11Z","git_url":"git://github.com/JoinMarket-Org/joinmarket-clientserver.git","ssh_url":"git@github.com:JoinMarket-Org/joinmarket-clientserver.git","clone_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver.git","svn_url":"https://github.com/JoinMarket-Org/joinmarket-clientserver","homepage":null,"size":3948,"stargazers_count":140,"watchers_count":140,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":57,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":59,"open_issues":57,"watchers":140,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444"},"html":{"href":"https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/444"},"issue":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/444"},"comments":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/issues/444/comments"},"review_comments":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444/comments"},"review_comment":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/pulls/444/commits"},"statuses":{"href":"https://api.github.com/repos/JoinMarket-Org/joinmarket-clientserver/statuses/ae7bd90ddfdea73d00471a3bb19724fdcbb93826"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"AdamISZ"}}