gettransaction RPC always includes watchonly in credit calculation? #4870

issue sipa opened this issue on September 8, 2014
  1. sipa commented at 1:34 PM on September 8, 2014: member

    in rpcwallet.cpp:gettransaction, filter is passed to wtx.GetCredit, which takes a boolean parameter fUseCache, but always includes both spendable and watchonly credit.

    (I haven't tested; just judging by the code)

  2. sipa added the label Bug on Sep 8, 2014
  3. sipa added the label Wallet on Sep 8, 2014
  4. cozz commented at 5:10 PM on September 8, 2014: contributor

    The bug is that the filter parameter has been forgotten to add in wtx.GetCredit. Like this

    -    int64_t GetCredit(bool fUseCache=true) const
    +    int64_t GetCredit(const isminefilter& filter) const
    

    The variable nWatchCreditCached is even defined in constructor, but never used. I have this and some other minor watch-only fixes laying around on my harddrive for a while now. I will look into submitting the pull request this week.

  5. laanwj closed this on Oct 13, 2014

  6. MarcoFalke locked this on Sep 8, 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-19 03:15 UTC

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