{"action":"created","issue":{"url":"https://api.github.com/repos/spesmilo/electrum/issues/1525","labels_url":"https://api.github.com/repos/spesmilo/electrum/issues/1525/labels{/name}","comments_url":"https://api.github.com/repos/spesmilo/electrum/issues/1525/comments","events_url":"https://api.github.com/repos/spesmilo/electrum/issues/1525/events","html_url":"https://github.com/spesmilo/electrum/issues/1525","id":113971192,"number":1525,"title":"Command-line: Wallet balance is not updated after sent transaction and fails on second tx","user":{"login":"NiExTy","id":13515355,"avatar_url":"https://avatars.githubusercontent.com/u/13515355?v=3","gravatar_id":"","url":"https://api.github.com/users/NiExTy","html_url":"https://github.com/NiExTy","followers_url":"https://api.github.com/users/NiExTy/followers","following_url":"https://api.github.com/users/NiExTy/following{/other_user}","gists_url":"https://api.github.com/users/NiExTy/gists{/gist_id}","starred_url":"https://api.github.com/users/NiExTy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiExTy/subscriptions","organizations_url":"https://api.github.com/users/NiExTy/orgs","repos_url":"https://api.github.com/users/NiExTy/repos","events_url":"https://api.github.com/users/NiExTy/events{/privacy}","received_events_url":"https://api.github.com/users/NiExTy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":45,"created_at":"2015-10-29T03:25:23Z","updated_at":"2015-11-11T14:25:02Z","closed_at":null,"body":"I have wallet (restored from 1 private key) that is not updating balance after sent transactions.\r\n\r\n**Querying wallet balance:**\r\n\r\n``$ electrum getbalance``\r\n```json\r\n{\r\n    \"confirmed\": \"0.01\"\r\n}\r\n```\r\n\r\n**Sending transactions:**\r\n\r\n``$ electrum paytomany ... | electrum broadcast -``\r\n``\r\nTXID\r\n``\r\n\r\n**Checking wallet balance again:**\r\n\r\n``$ electrum getbalance``\r\n```json\r\n{\r\n    \"confirmed\": \"0.01\"\r\n}\r\n```\r\n:beetle: ``getbalance`` is returning old wallet balance, transaction is confirmed on blockchain.\r\n\r\n``$ electrum getaddressbalance ADDRESS``\r\n```json\r\n{\r\n    \"confirmed\": \"0.0049\", \r\n    \"unconfirmed\": \"0\"\r\n}\r\n```\r\n``getaddressbalance`` returned correct address balance.\r\n\r\n**Daemon status**\r\n\r\n``$ electrum daemon status``\r\n```json\r\n{\r\n    \"auto_connect\": true, \r\n    \"blockchain_height\": 381018, \r\n    \"connected\": true, \r\n    \"nodes\": [\r\n        \"electrum.bahiadelsol.io:5002:s\", \r\n        \"ecdsa.net:110:s\", \r\n        \"erbium1.sytes.net:50002:s\", \r\n        \"electrum.be:50002:s\", \r\n        \"VPS.hsmiths.com:50002:s\", \r\n        \"electrum.bauerj.eu:50002:s\", \r\n        \"us.electrum.be:50002:s\"\r\n    ], \r\n    \"path\": \"/home/user2/.electrum\", \r\n    \"server\": \"ecdsa.net\", \r\n    \"server_height\": 381018\r\n}\r\n```\r\n\r\nDifferent servers and daemon restart didn't help on next transaction I am getting:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/electrum\", line 473, in <module>\r\n    result = run_command(config, None, password)\r\n  File \"/usr/local/bin/electrum\", line 265, in run_command\r\n    result = func(*args)\r\n  File \"/usr/local/lib/python2.7/dist-packages/electrum/commands.py\", line 70, in func_wrapper\r\n    return func(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/electrum/commands.py\", line 432, in paytomany\r\n    tx = self._mktx(outputs, tx_fee, change_addr, domain, nocheck, unsigned)\r\n  File \"/usr/local/lib/python2.7/dist-packages/electrum/commands.py\", line 414, in _mktx\r\n    coins = self.wallet.get_spendable_coins(domain)\r\n  File \"/usr/local/lib/python2.7/dist-packages/electrum/wallet.py\", line 617, in get_spendable_coins\r\n    c = self.get_addr_utxo(addr)\r\n  File \"/usr/local/lib/python2.7/dist-packages/electrum/wallet.py\", line 583, in get_addr_utxo\r\n    coins.pop(txi)\r\nKeyError: u'64-CHAR-HASH-EDITED-FOR-PRIVACY:4'\r\n{\r\n    \"error\": \"Traceback (most recent call last):\\n  File \\\"/usr/local/bin/electrum\\\", line 319, in run\\n    response = run_command(config, self.network, password)\\n  File \\\"/usr/local/bin/electrum\\\", line 265, in run_command\\n    result = func(*args)\\n  File \\\"/usr/local/lib/python2.7/dist-packages/electrum/commands.py\\\", line 70, in func_wrapper\\n    return func(*args, **kwargs)\\n  File \\\"/usr/local/lib/python2.7/dist-packages/electrum/commands.py\\\", line 228, in broadcast\\n    return self.network.synchronous_get(('blockchain.transaction.broadcast', [str(t)]))\\n  File \\\"/usr/local/lib/python2.7/dist-packages/electrum/transaction.py\\\", line 469, in __str__\\n    self.raw = self.serialize()\\n  File \\\"/usr/local/lib/python2.7/dist-packages/electrum/transaction.py\\\", line 651, in serialize\\n    outputs = self.outputs\\nAttributeError: Transaction instance has no attribute 'outputs'\\n\"\r\n}\r\n```\r\nVersion: Electrum 2.5.2"},"comment":{"url":"https://api.github.com/repos/spesmilo/electrum/issues/comments/155796344","html_url":"https://github.com/spesmilo/electrum/issues/1525#issuecomment-155796344","issue_url":"https://api.github.com/repos/spesmilo/electrum/issues/1525","id":155796344,"user":{"login":"kyuupichan","id":3319176,"avatar_url":"https://avatars.githubusercontent.com/u/3319176?v=3","gravatar_id":"","url":"https://api.github.com/users/kyuupichan","html_url":"https://github.com/kyuupichan","followers_url":"https://api.github.com/users/kyuupichan/followers","following_url":"https://api.github.com/users/kyuupichan/following{/other_user}","gists_url":"https://api.github.com/users/kyuupichan/gists{/gist_id}","starred_url":"https://api.github.com/users/kyuupichan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyuupichan/subscriptions","organizations_url":"https://api.github.com/users/kyuupichan/orgs","repos_url":"https://api.github.com/users/kyuupichan/repos","events_url":"https://api.github.com/users/kyuupichan/events{/privacy}","received_events_url":"https://api.github.com/users/kyuupichan/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T14:25:02Z","updated_at":"2015-11-11T14:25:02Z","body":"@NiExTy thanks, returned spent coins + fees"}}