Label support seems insufficient to replace accounts #14382

issue Saicere openend this issue on October 3, 2018
  1. Saicere commented at 2:05 pm on October 3, 2018: none

    While most of the additional functionality the old account system had over the label system were irrelevant, there is one critical functionality that no longer seems to be possible with labels - specifically, the ability to request a list of transactions (TXID + amount) that pay to addresses with a given account/label. As per the release notes for 0.17.0. the listtransaction method was changed as follows;

    The account named parameter has been renamed to dummy. If provided, the dummy parameter must be set to the string *, unless running with the -deprecatedrpc=accounts argument (in which case functionality is unchanged).

    getreceivedbylabel and getreceivedbyaddress only returns the balance, while listreceivedbylabel and listreceivedbyaddress do not actually filter; additionally, the former does not list transactions at all, while the latter does not include the amounts per TXID. While you could use getaddressesbylabel to iterate over addresses, there is no corresponding method to get the TXIDs and amounts from this list of addresses. None of these can therefore be used as a direct replacement for this method.

    The only way I can see to get anything resembling the old functionality with the API changes is to dump the entire transaction history with listreceivedbyaddress, filter the result by label manually, then use gettransaction on each listed TXID. This is both very fiddly and very inefficient, and likely impossible when you go past a certain number of lifetime transactions.

    Am I missing something here, or will it really no longer possible be to iterate over transactions received by account/label? If so, this basically means that many applications will no longer be usable with releases starting from Bitcoin Core 0.18.

  2. kristapsk commented at 9:46 pm on October 3, 2018: contributor
    It looks to me JoinMarket’s current codebase also have this issue, see https://github.com/JoinMarket-Org/joinmarket-clientserver/issues/185.
  3. ryanofsky commented at 5:56 am on October 4, 2018: member
    If we replace the listtransactions dummy argument (formerly account) with a working label argument, would that fix the problem? I think this would be easy to implement, with the caveat that unlike the previous account argument which matched both incoming and outgoing transactions, this would only be able to return incoming transactions, since the wallet no longer tries to associate outgoing transactions with accounts.
  4. MarcoFalke added the label Wallet on Oct 4, 2018
  5. MarcoFalke added the label RPC/REST/ZMQ on Oct 4, 2018
  6. Saicere commented at 9:03 am on October 4, 2018: none

    If we replace the listtransactions dummy argument (formerly account) with a working label argument, would that fix the problem?

    That is correct. My use case (which I assume is not an uncommon one) is simply to assign one or more addresses to a user by means of a unique account/label, and then query for incoming transactions to that user on certain events. As long as listtransactions can still be used for this, everything else is a trivial update.

    Thanks for looking into this.

  7. ryanofsky referenced this in commit 8fcb765084 on Oct 6, 2018
  8. jnewbery commented at 8:17 am on October 8, 2018: member
    Thanks for reporting this @Saicere!
  9. jnewbery referenced this in commit c8d1f1513f on Oct 9, 2018
  10. ryanofsky referenced this in commit fa7fae5c36 on Oct 10, 2018
  11. ryanofsky referenced this in commit 4deba4ced9 on Oct 10, 2018
  12. jnewbery referenced this in commit 89306ab0df on Oct 10, 2018
  13. ryanofsky referenced this in commit 7cbe74f152 on Oct 15, 2018
  14. laanwj referenced this in commit 5150accdd2 on Nov 10, 2018
  15. ryanofsky referenced this in commit b6ccb77270 on Nov 12, 2018
  16. ryanofsky referenced this in commit 3f05bcbf5d on Nov 13, 2018
  17. ryanofsky referenced this in commit 65b740f92b on Nov 13, 2018
  18. MarcoFalke closed this on Nov 14, 2018

  19. MarcoFalke referenced this in commit e74649e951 on Nov 14, 2018
  20. JeremyRubin referenced this in commit 19581b0f3f on Nov 24, 2018
  21. HashUnlimited referenced this in commit 2d9f1046e7 on Nov 26, 2018
  22. xdustinface referenced this in commit de7c6514a3 on Dec 22, 2020
  23. xdustinface referenced this in commit 96d306324f on Dec 22, 2020
  24. UdjinM6 referenced this in commit b25d608471 on Aug 7, 2021
  25. DrahtBot locked this on Sep 8, 2021
  26. UdjinM6 referenced this in commit 7dc5565c7d on Sep 17, 2021
  27. kittywhiskers referenced this in commit 0cfa457848 on Oct 12, 2021
  28. gades referenced this in commit e9ecdca335 on Mar 27, 2022
  29. gades referenced this in commit 12c7e3b4c3 on Jun 1, 2022

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: 2024-11-17 15:12 UTC

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