{"action":"opened","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7777","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7777/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7777/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7777/events","html_url":"https://github.com/bitcoin/bitcoin/issues/7777","id":144943515,"number":7777,"title":"Wallet problem when TX has three receive addresses","user":{"login":"trevelocity","id":8991626,"avatar_url":"https://avatars.githubusercontent.com/u/8991626?v=3","gravatar_id":"","url":"https://api.github.com/users/trevelocity","html_url":"https://github.com/trevelocity","followers_url":"https://api.github.com/users/trevelocity/followers","following_url":"https://api.github.com/users/trevelocity/following{/other_user}","gists_url":"https://api.github.com/users/trevelocity/gists{/gist_id}","starred_url":"https://api.github.com/users/trevelocity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevelocity/subscriptions","organizations_url":"https://api.github.com/users/trevelocity/orgs","repos_url":"https://api.github.com/users/trevelocity/repos","events_url":"https://api.github.com/users/trevelocity/events{/privacy}","received_events_url":"https://api.github.com/users/trevelocity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-31T16:00:49Z","updated_at":"2016-03-31T16:00:49Z","closed_at":null,"body":"This is with Bitcoind 0.11.2 on Linux x86_64.\r\nI used the Receive tab in bicoin-qt to generate three addresses.\r\nI then created a raw transaction sending bitcoins to those three addresses.\r\n>> bitcoin-cli  getrawtransaction 796ce009e1f146d3cc296adf94a69c19faf415adb73b0ffdd78acb74418e48d1 1\r\n....\r\n\"vout\" : [\r\n        {\r\n            \"value\" : 0.00110000,\r\n            \"n\" : 0,\r\n            \"scriptPubKey\" : {\r\n                \"asm\" : \"OP_DUP OP_HASH160 39b932cd29f9f1ad6f9fafe30fc332f603c86713 OP_EQUALVERIFY OP_CHECKSIG\",\r\n                \"hex\" : \"76a91439b932cd29f9f1ad6f9fafe30fc332f603c8671388ac\",\r\n                \"reqSigs\" : 1,\r\n                \"type\" : \"pubkeyhash\",\r\n                \"addresses\" : [\r\n                    \"16GDNkNR4kG9VqcwWYWfZEtSBQ4PhNBq5r\"\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"value\" : 0.00120000,\r\n            \"n\" : 1,\r\n            \"scriptPubKey\" : {\r\n                \"asm\" : \"OP_DUP OP_HASH160 66e4f7fb49135e280cb9e3985b055f644baaafe4 OP_EQUALVERIFY OP_CHECKSIG\",\r\n                \"hex\" : \"76a91466e4f7fb49135e280cb9e3985b055f644baaafe488ac\",\r\n                \"reqSigs\" : 1,\r\n                \"type\" : \"pubkeyhash\",\r\n                \"addresses\" : [\r\n                    \"1AP4DbBbuLjuSMku8RG6P4cu7q9sHzSjmB\"\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"value\" : 0.00130000,\r\n            \"n\" : 2,\r\n            \"scriptPubKey\" : {\r\n                \"asm\" : \"OP_DUP OP_HASH160 9a83cc700afd2237e50eff4f3647301cc48b4c86 OP_EQUALVERIFY OP_CHECKSIG\",\r\n                \"hex\" : \"76a9149a83cc700afd2237e50eff4f3647301cc48b4c8688ac\",\r\n                \"reqSigs\" : 1,\r\n                \"type\" : \"pubkeyhash\",\r\n                \"addresses\" : [\r\n                    \"1F5zx4x3htK36uvXqHscmY9u91nGy6qNYe\"\r\n                ]\r\n            }\r\n        },\r\n....\r\nWhen I check the wallet to see if the bitcoins have been received I get this:\r\nbitcoin-cli  getreceivedbyaddress 16GDNkNR4kG9VqcwWYWfZEtSBQ4PhNBq5r\r\n0.00000000\r\nbitcoin-cli  getreceivedbyaddress 1AP4DbBbuLjuSMku8RG6P4cu7q9sHzSjmB\r\n0.00120000\r\nbitcoin-cli  getreceivedbyaddress 1F5zx4x3htK36uvXqHscmY9u91nGy6qNYe\r\n0.00130000\r\n\r\nThe first issue is that vout0 is not reported as being received (i.e. the 0.0011 is not shown).\r\nThe second issue is that in the bitcoin-qt Transaction tab, it shows vout1 and vout2, but in\r\n\"Show transaction details\" for vout1 and vout2 it shows, in both cases, \"Net amount: +0.00250000 BTC\". The total for the TX is 0.0036, but it would be better if it displayed the total for the \"address\" rather than the TX in the pop-up window.\r\n"}}