listtransactions - no sent txs #15634

issue ega-forever opened this issue on March 21, 2019
  1. ega-forever commented at 1:22 PM on March 21, 2019: none

    Found an issue in v0.17.1, which is related to listing the txs for wallet account. According to these release notes https://bitcoin.org/en/release/v0.17.1#listtransactions-label-support - I am able to specify the "-deprecatedrpc=accounts" option, in order to obtain the to/from txs for the certain account. However, I still see only incoming txs in a reply.

    Here is my config:

    deprecatedrpc=accounts
     
    [test]
    testnet=1
    server=1
    rpcport=8333
    zmqpubhashtx=tcp://127.0.0.1:43332
    zmqpubrawtx=tcp://127.0.0.1:43332
    rpcuser=user
    rpcpassword=123
    txindex=1
    

    Here is my test address: 2NEKqdWqcF649fkHW8osPUht42zY7gY3iQK And reply:

    [
        {
            "result": [
                {
                    "involvesWatchonly": true,
                    "account": "2NEKqdWqcF649fkHW8osPUht42zY7gY3iQK",
                    "address": "2NEKqdWqcF649fkHW8osPUht42zY7gY3iQK",
                    "category": "receive",
                    "amount": 126.59484532,
                    "label": "2NEKqdWqcF649fkHW8osPUht42zY7gY3iQK",
                    "vout": 1,
                    "confirmations": 24,
                    "blockhash": "0000000012df77807187ed6bd90b79cfcf0d4987eec27f435bf0727e8bd92df4",
                    "blockindex": 21,
                    "blocktime": 1553156910,
                    "txid": "8b213eb71c7987027ab51f86403666dcd420396d990236aaef843fc2c54e2e1a",
                    "walletconflicts": [],
                    "time": 1553163776,
                    "timereceived": 1553169937,
                    "bip125-replaceable": "no"
                }
            ],
            "error": null,
            "id": null
        }
    ]
    
  2. ega-forever renamed this:
    listtransactions - no received txs
    listtransactions - no sent txs
    on Mar 21, 2019
  3. MarcoFalke added the label RPC/REST/ZMQ on Mar 21, 2019
  4. MarcoFalke added the label Questions and Help on Mar 21, 2019
  5. MarcoFalke commented at 8:34 PM on March 21, 2019: member

    This is not a regression. (I tested with Bitcoin Core 0.14.0 that "sent txs" are not listed for accounts)

    If I am mistaken, please provide exact steps to reproduce.

    Screenshot from 2019-03-21 16-34-06

  6. MarcoFalke closed this on Mar 21, 2019

  7. ega-forever commented at 5:52 AM on March 22, 2019: none

    Thanks for the reply. It seems, that I've provided in the example the wrong address - really sorry for that. Anyway, here is my case: I have the btc testnet. I make the curl request:

    curl -X POST \ http://localhost:8333/ \ -H 'Authorization: Basic dXNlcjoxMjM=' \ -H 'Content-Type: application/json' \ -H 'Postman-Token: d3f218b3-beda-4039-b7d1-a10d4c2aefc1' \ -H 'cache-control: no-cache' \ -d '[{ "method": "listtransactions", "params": ["2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", 10, 0,true] }]'

    Get the reply:

    [ { "result": [ { "involvesWatchonly": true, "account": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "address": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "category": "receive", "amount": 0.0923395, "label": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "vout": 1, "confirmations": 95, "blockhash": "00000000000000311928217f89e08dbc4dca5a18b1f8f6da4d194e51327bcb1b", "blockindex": 1, "blocktime": 1553157021, "txid": "f33d089420856f37bfdc85c75ed58b160fc9f4adbf37bcfc49d443b981e3f388", "walletconflicts": [], "time": 1553157021, "timereceived": 1553169034, "bip125-replaceable": "no" } ], "error": null, "id": null } ]

    Here I see only received txs. However, when I do request like this:

    curl -X POST \ http://localhost:8333/ \ -H 'Authorization: Basic dXNlcjoxMjM=' \ -H 'Content-Type: application/json' \ -H 'Postman-Token: bcf5c592-aada-42e7-83b2-6c48cc9fea75' \ -H 'cache-control: no-cache' \ -d '[{ "method": "listtransactions", "params": ["*", 10, 0,true] }]'

    I receive: [ { "result": [ { "involvesWatchonly": true, "account": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "address": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "category": "receive", "amount": 0.0923395, "label": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "vout": 1, "confirmations": 95, "blockhash": "00000000000000311928217f89e08dbc4dca5a18b1f8f6da4d194e51327bcb1b", "blockindex": 1, "blocktime": 1553157021, "txid": "f33d089420856f37bfdc85c75ed58b160fc9f4adbf37bcfc49d443b981e3f388", "walletconflicts": [], "time": 1553157021, "timereceived": 1553169034, "bip125-replaceable": "no" }, { "involvesWatchonly": true, "account": "", "address": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "category": "send", "amount": -0.0923395, "label": "2NEz5PM8ao84V4BYvkZDKXo5E5QP11gbM58", "vout": 1, "fee": -0.0001673, "confirmations": 95, "blockhash": "00000000000000311928217f89e08dbc4dca5a18b1f8f6da4d194e51327bcb1b", "blockindex": 1, "blocktime": 1553157021, "txid": "f33d089420856f37bfdc85c75ed58b160fc9f4adbf37bcfc49d443b981e3f388", "walletconflicts": [], "time": 1553157021, "timereceived": 1553169034, "bip125-replaceable": "no", "abandoned": false } ], "error": null, "id": null } ]

    So, in the second case, I get 2 txs - one sent, and one received. I believe that in the first case I should receive both txs as well.

  8. MarcoFalke removed the label Questions and Help on Mar 22, 2019
  9. MarcoFalke reopened this on Mar 22, 2019

  10. MarcoFalke commented at 7:16 PM on March 22, 2019: member

    Closing. This is not a regression as far as I can see.

    0.16.1 would only ever display received txs:

    Screenshot from 2019-03-22 15-15-21 Screenshot from 2019-03-22 15-15-10

  11. MarcoFalke closed this on Mar 22, 2019

  12. ega-forever commented at 12:47 PM on March 23, 2019: none

    Could you please try against this address "2N8QJEnkuD4S5T6gKAd9e6744taLkGo7QWs" (or any other address, which has incoming and outcoming txs) and check that you are able to receive the txs of both categories "receive" and "sent"?

  13. MarcoFalke commented at 3:00 PM on March 23, 2019: member

    @ega-forever Is this a bug report (regression) or feature request?

    If it is a regression, please specify a version of Bitcoin Core that returned the "correct" result

    If it is a feature request, please be reminded that accounts have been completely removed as of 0.18.0 (to be released in two weeks). The concept of sending from an account (or address) was highly misleading. Is there a specific use case you are trying to solve?

  14. ega-forever commented at 3:46 PM on March 23, 2019: none

    "accounts have been completely removed" - i thought they will be replaced with "label" - but functionality will remain the same.

    Anyway, here is my use case: we are going to use bitcoind for tracking the balance /utxo /tx history of our users. For the moment we do it like so: when a new user registers, we add his address to wallets on bitcoind (through the import API). After that, we are able to show him the balance, utxo, and transactions.

    So, my questions are:

    1. how do we can to obtain all transactions for the certain address (especially when we have 100+ addresses already added)?
    2. is it difficult for you to implement an option, which will index all balances / utxo / txes for all addresses (so we could skip the step with adding the watch-only addresses)?
    3. in case the second point is possible, is there any chances that forks like litecoin or bitcoin cash will add this feature as well (as far as I know - they are forks of bitcoin)?
  15. MarcoFalke commented at 3:56 PM on March 23, 2019: member

    Bitcoin Core's wallet is not a database to keep track of individual user's funds of your service. This is out of scope for our software project.

    The high level idea is to track user's balances and tx history in your own database. You give each user a new address for each incoming send and record that payment (txid) in your database as soon as it is sufficiently confirmed. You ask each user for a new address for each outgoing send and record the txid in your database as well.

    If the user needs access to utxos, you should encourage them to use Bitcoin Core or another wallet that holds the private keys for them.

    Be reminded that this issue tracker is used to track technical issues related to the Bitcoin Core code base and not for consulting or support. Those general bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange.

  16. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me