{"action":"created","issue":{"url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/14","repository_url":"https://api.github.com/repos/chris-belcher/electrum-personal-server","labels_url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/14/comments","events_url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/14/events","html_url":"https://github.com/chris-belcher/electrum-personal-server/issues/14","id":311528416,"node_id":"MDU6SXNzdWUzMTE1Mjg0MTY=","number":14,"title":"Crash by transaction conflict in wallet","user":{"login":"fivepiece","id":5624963,"node_id":"MDQ6VXNlcjU2MjQ5NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5624963?v=4","gravatar_id":"","url":"https://api.github.com/users/fivepiece","html_url":"https://github.com/fivepiece","followers_url":"https://api.github.com/users/fivepiece/followers","following_url":"https://api.github.com/users/fivepiece/following{/other_user}","gists_url":"https://api.github.com/users/fivepiece/gists{/gist_id}","starred_url":"https://api.github.com/users/fivepiece/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fivepiece/subscriptions","organizations_url":"https://api.github.com/users/fivepiece/orgs","repos_url":"https://api.github.com/users/fivepiece/repos","events_url":"https://api.github.com/users/fivepiece/events{/privacy}","received_events_url":"https://api.github.com/users/fivepiece/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-04-05T09:05:55Z","updated_at":"2018-06-09T14:38:57Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"How to reproduce:\r\n\r\n1. send funds to an address in electrum\r\n\r\nEPS:\r\n```\r\n11:54:17,713776 [  LOG] Found new tx: {'fee': 3800, 'height': 0, 'tx_hash': '9a793494a83cb161d727342cf39f187bbab907440afe6c5aac17fde876d98286'}\r\n```\r\n\r\nelectrum history:\r\n```python\r\n{\r\n    \"summary\": {\r\n        \"end_balance\": \"10. BTC\",\r\n        \"end_date\": null,\r\n        \"expenditures\": \"0. BTC\",\r\n        \"income\": \"10. BTC\",\r\n        \"start_balance\": \"0. BTC\",\r\n        \"start_date\": null\r\n    },\r\n    \"transactions\": [\r\n        {\r\n            \"balance\": \"10. BTC\",\r\n            \"confirmations\": 0,\r\n            \"date\": null,\r\n            \"height\": -2,\r\n            \"label\": \"\",\r\n            \"timestamp\": null,\r\n            \"txid\": \"9a793494a83cb161d727342cf39f187bbab907440afe6c5aac17fde876d98286\",\r\n            \"value\": \"10. BTC\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\n2. use `bumpfee` to create a conflict (here `bank` is just a regtest node to distribute money.  not the same one that EPS runs on top of)\r\n\r\nbitcoin-cli:\r\n```\r\n$ bank-cli bumpfee 9a793494a83cb161d727342cf39f187bbab907440afe6c5aac17fde876d98286\r\n{\r\n  \"txid\": \"2056ea4973d7d2236d086dfc89b8ece13669fa3e61b304b4f50814d4dbaf1fe7\",\r\n  \"origfee\": 0.00003800,\r\n  \"fee\": 0.00004750,\r\n  \"errors\": [\r\n  ]\r\n}\r\n```\r\n\r\nEPS:\r\n```\r\n11:56:07,976394 [  LOG] Found new tx: {'fee': 4750, 'height': 0, 'tx_hash': '2056ea4973d7d2236d086dfc89b8ece13669fa3e61b304b4f50814d4dbaf1fe7'}\r\n```\r\n\r\nelectrum history:\r\n```python\r\n{\r\n    \"summary\": {\r\n        \"end_balance\": \"20. BTC\",\r\n        \"end_date\": null,\r\n        \"expenditures\": \"0. BTC\",\r\n        \"income\": \"20. BTC\",\r\n        \"start_balance\": \"0. BTC\",\r\n        \"start_date\": null\r\n    },\r\n    \"transactions\": [\r\n        {\r\n            \"balance\": \"10. BTC\",\r\n            \"confirmations\": 0,\r\n            \"date\": null,\r\n            \"height\": -2,\r\n            \"label\": \"\",\r\n            \"timestamp\": null,\r\n            \"txid\": \"9a793494a83cb161d727342cf39f187bbab907440afe6c5aac17fde876d98286\",\r\n            \"value\": \"10. BTC\"\r\n        },\r\n        {\r\n            \"balance\": \"20. BTC\",\r\n            \"confirmations\": 0,\r\n            \"date\": null,\r\n            \"height\": -2,\r\n            \"label\": \"\",\r\n            \"timestamp\": null,\r\n            \"txid\": \"2056ea4973d7d2236d086dfc89b8ece13669fa3e61b304b4f50814d4dbaf1fe7\",\r\n            \"value\": \"10. BTC\"\r\n        }\r\n    ]\r\n}\r\n```\r\nthere are two unconfirmed transactions, electrum seems to think that our balance is increased by the amount in both\r\n\r\n\r\n3. generate one block\r\n\r\nEPS:\r\n```\r\n11:59:34,121537 [  LOG] A transaction confirmed: 9a793494a83cb161d727342cf39f187bbab907440afe6c5aac17fde876d98286\r\nTraceback (most recent call last):\r\n  File \"p2pkh/server.py\", line 290, in run_electrum_server\r\n    recv_data = sock.recv(4096)\r\n  File \"/usr/lib/python3.5/ssl.py\", line 922, in recv\r\n    return self.read(buflen)\r\n  File \"/usr/lib/python3.5/ssl.py\", line 799, in read\r\n    return self._sslobj.read(len, buffer)\r\n  File \"/usr/lib/python3.5/ssl.py\", line 585, in read\r\n    v = self._sslobj.read(len)\r\nsocket.timeout: The read operation timed out\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"p2pkh/server.py\", line 485, in <module>\r\n    main()\r\n  File \"p2pkh/server.py\", line 482, in main\r\n    poll_interval_connected, certfile, keyfile)\r\n  File \"p2pkh/server.py\", line 304, in run_electrum_server\r\n    on_heartbeat_connected(sock, rpc, txmonitor)\r\n  File \"p2pkh/server.py\", line 86, in on_heartbeat_connected\r\n    updated_scripthashes = txmonitor.check_for_updated_txes()\r\n  File \"/home/user/software/crypto/electrum-personal-server/electrumpersonalserver/transactionmonitor.py\", line 239, in check_for_updated_txes\r\n    updated_scrhashes2 = self.check_for_confirmations()\r\n  File \"/home/user/software/crypto/electrum-personal-server/electrumpersonalserver/transactionmonitor.py\", line 265, in check_for_confirmations\r\n    block = self.rpc.call(\"getblockheader\", [tx[\"blockhash\"]])\r\nKeyError: 'blockhash'\r\n```\r\n\r\nPerhaps we should be looking at the `\"walletconflicts\"` field in `gettransaction`, also not attempt to return proofs for unconfirmed transactions?"},"comment":{"url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/comments/395974314","html_url":"https://github.com/chris-belcher/electrum-personal-server/issues/14#issuecomment-395974314","issue_url":"https://api.github.com/repos/chris-belcher/electrum-personal-server/issues/14","id":395974314,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTk3NDMxNA==","user":{"login":"bwhm","id":35237943,"node_id":"MDQ6VXNlcjM1MjM3OTQz","avatar_url":"https://avatars2.githubusercontent.com/u/35237943?v=4","gravatar_id":"","url":"https://api.github.com/users/bwhm","html_url":"https://github.com/bwhm","followers_url":"https://api.github.com/users/bwhm/followers","following_url":"https://api.github.com/users/bwhm/following{/other_user}","gists_url":"https://api.github.com/users/bwhm/gists{/gist_id}","starred_url":"https://api.github.com/users/bwhm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwhm/subscriptions","organizations_url":"https://api.github.com/users/bwhm/orgs","repos_url":"https://api.github.com/users/bwhm/repos","events_url":"https://api.github.com/users/bwhm/events{/privacy}","received_events_url":"https://api.github.com/users/bwhm/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T14:38:57Z","updated_at":"2018-06-09T14:38:57Z","author_association":"NONE","body":"Hi again,\r\n\r\nI have been running the script with screen, so I didn't notice this before as it doesn't show up in the log file:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./server.py\", line 534, in <module>\r\n    main()\r\n  File \"./server.py\", line 531, in main\r\n    poll_interval_listening, poll_interval_connected, certfile, keyfile)\r\n  File \"./server.py\", line 340, in run_electrum_server\r\n    txmonitor)\r\n  File \"./server.py\", line 117, in handle_query\r\n    tx = rpc.call(\"gettransaction\", [query[\"params\"][0]])\r\n  File \"/home/pi/electrum-personal-server/electrumpersonalserver/jsonrpc.py\", line 58, in call\r\n    raise JsonRpcError(response[\"error\"])\r\nelectrumpersonalserver.jsonrpc.JsonRpcError: {'code': -5, 'message': 'Invalid or non-wallet transaction id'}\r\n```\r\n\r\nThis was not the latest master. I am guessing it is the replaced transaction acting up. Unless the error is obvious to you, maybe there is a way I can edit the code manually to disregard it for now?"}}
{"actor":{"display_login":"bwhm"}}