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)
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)
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.