{"action":"opened","issue":{"url":"https://api.github.com/repos/spesmilo/electrum/issues/4170","repository_url":"https://api.github.com/repos/spesmilo/electrum","labels_url":"https://api.github.com/repos/spesmilo/electrum/issues/4170/labels{/name}","comments_url":"https://api.github.com/repos/spesmilo/electrum/issues/4170/comments","events_url":"https://api.github.com/repos/spesmilo/electrum/issues/4170/events","html_url":"https://github.com/spesmilo/electrum/issues/4170","id":308195004,"number":4170,"title":"Ledger hw.1 can only create txn with single output","user":{"login":"SomberNight","id":29142493,"avatar_url":"https://avatars2.githubusercontent.com/u/29142493?v=4","gravatar_id":"","url":"https://api.github.com/users/SomberNight","html_url":"https://github.com/SomberNight","followers_url":"https://api.github.com/users/SomberNight/followers","following_url":"https://api.github.com/users/SomberNight/following{/other_user}","gists_url":"https://api.github.com/users/SomberNight/gists{/gist_id}","starred_url":"https://api.github.com/users/SomberNight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SomberNight/subscriptions","organizations_url":"https://api.github.com/users/SomberNight/orgs","repos_url":"https://api.github.com/users/SomberNight/repos","events_url":"https://api.github.com/users/SomberNight/events{/privacy}","received_events_url":"https://api.github.com/users/SomberNight/received_events","type":"User","site_admin":false},"labels":[{"id":10740358,"url":"https://api.github.com/repos/spesmilo/electrum/labels/bug","name":"bug","color":"b60205","default":true},{"id":163477206,"url":"https://api.github.com/repos/spesmilo/electrum/labels/hw-ledger","name":"hw-ledger","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T22:20:14Z","updated_at":"2018-03-23T22:20:14Z","closed_at":null,"author_association":"MEMBER","body":"On git master 382f69edd9a27dd37744d4eac3d3c8164afc0ae4.\r\n\r\nTrying to sign a transactions with a ledger hw.1 (firmware version 1.0.4, latest atm).\r\nIt only succeeds if the transactions has one output (no change either).\r\nIf there are three or more outputs, I get `Exception: Transaction with more than 2 outputs not supported` which is most likely expected.\r\nHowever, if there are two outputs (i.e. there is change), I get `Invalid status 6a80`\r\n\r\n<details>\r\n <summary>log</summary>\r\n\r\n```\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n=> b'e042000009000000000100000001'\r\n<= b''9000\r\n=> b'e042800025e2b7908358705e9d941884b6710b4eae9062911e085918f3681677930f17a3f9000000006a'\r\n<= b''9000\r\n=> b'e04280006e473044022050830a4ddfda472ed7cd6fb475a25079bdca4e94796fba00cb7c6064fad0adb702205b555b533d1c5165182746a22ae863ced8675df700cc452e8ac1127452ab65b4012103ad26fb33dfbdfcf70d6d5a76918be8d06e324279cb638ded9103a7c893389e35fdffffff'\r\n<= b''9000\r\n=> b'e04280000103'\r\n<= b''9000\r\n=> b'e04280000920a107000000000019'\r\n<= b''9000\r\n=> b'e04280001976a9142ca45dbe0c0d7c1ceae80c8ff67ada77dbb87c5f88ac'\r\n<= b''9000\r\n=> b'e04280000920a107000000000017'\r\n<= b''9000\r\n=> b'e042800017a9148ae694d8ae72693a399c5bd203243e1ecb8ecfe387'\r\n<= b''9000\r\n=> b'e042800009fe330c000000000019'\r\n<= b''9000\r\n=> b'e04280001976a914e3486bdaacaf84d5613b01b93abd3bea549a8cba88ac'\r\n<= b''9000\r\n=> b'e042800004f8a91300'\r\n<= b'3200d5f94c89caf0cd962a1c71c1c57386eb11ebdb2e54ea03abee15f9317062c150ea120000000020a1070000000000dc3d51a1355165f2'9000\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n=> b'e02601000101'\r\n<= b''9000\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n=> b'e0440000050100000001'\r\n<= b''9000\r\n=> b'e04480003b01383200d5f94c89caf0cd962a1c71c1c57386eb11ebdb2e54ea03abee15f9317062c150ea120000000020a1070000000000dc3d51a1355165f219'\r\n<= b''9000\r\n=> b'e04480001d76a9142ca45dbe0c0d7c1ceae80c8ff67ada77dbb87c5f88acfdffffff'\r\n<= b''9000\r\n[DeviceMgr] getting client for keystore\r\n[DeviceMgr] scanning devices...\r\n=> b'e0c4000000'\r\n<= b'01200100040110'9000\r\n[DeviceMgr] end client for keystore\r\n=> b'e04a80004502a0860100000000001976a9144a4a898a28213db81e3a86cba487e05d551a170088ac9e190600000000001976a914eb45bfaf226e14b366796c9510e177659526a4b888ac'\r\n[Network] network: retrying connections\r\n<= b''6a80\r\nTraceback (most recent call last):\r\n  File \"/home/user/wspace/electrum/plugins/ledger/ledger.py\", line 444, in sign_transaction\r\n    outputData = self.get_client().finalizeInputFull(txOutput)\r\n  File \"/usr/local/lib/python3.6/site-packages/btchip/btchip.py\", line 348, in finalizeInputFull\r\n    response = self.dongle.exchange(bytearray(apdu))\r\n  File \"/usr/local/lib/python3.6/site-packages/btchip/btchipComm.py\", line 127, in exchange\r\n    raise BTChipException(\"Invalid status %04x\" % sw, sw)\r\nbtchip.btchipException.BTChipException: Exception : Invalid status 6a80\r\nException : Invalid status 6a80\r\nTraceback (most recent call last):\r\n  File \"/home/user/wspace/electrum/plugins/ledger/ledger.py\", line 444, in sign_transaction\r\n    outputData = self.get_client().finalizeInputFull(txOutput)\r\n  File \"/usr/local/lib/python3.6/site-packages/btchip/btchip.py\", line 348, in finalizeInputFull\r\n    response = self.dongle.exchange(bytearray(apdu))\r\n  File \"/usr/local/lib/python3.6/site-packages/btchip/btchipComm.py\", line 127, in exchange\r\n    raise BTChipException(\"Invalid status %04x\" % sw, sw)\r\nbtchip.btchipException.BTChipException: Exception : Invalid status 6a80\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/user/wspace/electrum/gui/qt/util.py\", line 639, in run\r\n    result = task.task()\r\n  File \"/home/user/wspace/electrum/lib/wallet.py\", line 1465, in sign_transaction\r\n    k.sign_transaction(tx, password)\r\n  File \"/home/user/wspace/electrum/plugins/ledger/ledger.py\", line 244, in wrapper\r\n    return func(self, *args, **kwargs)\r\n  File \"/home/user/wspace/electrum/plugins/ledger/ledger.py\", line 472, in sign_transaction\r\n    self.give_error(e, True)\r\n  File \"/home/user/wspace/electrum/plugins/ledger/ledger.py\", line 237, in give_error\r\n    raise Exception(message)\r\nException: Exception : Invalid status 6a80\r\n```\r\n</details>\r\n\r\nThis seems to be broken since https://github.com/spesmilo/electrum/commit/e4659327a136f18fde59e4a1f60f45f3e16f22d6"}}
{"actor":{"display_login":"SomberNight"}}