-
Notifications
You must be signed in to change notification settings - Fork 94
Fix for importaddress returning incorrect amounts #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The PR does not exactly address the issue. Maybe the description is not clear enough, but I think he refers to an issue when importing cold staking addresses. |
@aguycalled Updated the test case to include cold staking addresses. |
just tested it, importing the spending or staking address in the second node does not show the balance as if it was an address owned by the wallet. |
@aguycalled oh, i assumed that the balance from addresses imported were not to be shown as if it was owned by the wallet, but only show transactions on the watched address. In this case, should commands like getbalance be updated to include balances from watched addresses? |
you are right, only the transactions are watched, but those do not appear for spending or staking addresses. |
So does that mean:
|
yes |
@francisjyap I think you just need to add those scenarios to the functional test, then fix the issue 👍 if it still exists. @aguycalled so the balance is not supposed to update, only the transactions list correct? |
watchonly addresses balance is only shown in qt iirc |
@mxaddict @aguycalled I updated the test cases per your suggestions and the transactions and balance from the imported addresses are reflected correctly. I added a Watched label on the UI showing the total balance from watched addresses. The Total label is also updated to reflect the total balance plus the total watched balance. |
utACK
…On Wed, May 15, 2019, 19:45 Francis Yap ***@***.***> wrote:
@mxaddict <https://github.com/mxaddict> @aguycalled
<https://github.com/aguycalled> I updated the test cases per your
suggestions and the transactions and balance from the imported addresses
are reflected correctly.
I added a Watched label on the UI showing the total balance from watched
addresses. The Total label is also updated to reflect the total balance
plus the total watched balance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#479?email_source=notifications&email_token=AAIDAKJWLCCBY4BDLZY7423PVPZU3A5CNFSM4HMBF7Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVOMXMQ#issuecomment-492620722>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIDAKKSVHRJHSYMDMT7LM3PVPZU3ANCNFSM4HMBF7YQ>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qa/rpc-tests/importaddress.py
Outdated
|
||
#import time | ||
|
||
class GetStakeReport(NavCoinTestFramework): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should match the name of the test
qa/rpc-tests/importaddress.py
Outdated
|
||
|
||
if __name__ == '__main__': | ||
GetStakeReport().main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to match the name of the file
qa/rpc-tests/importaddress.py
Outdated
self.nodes[2].importaddress(address) | ||
self.nodes[2].importaddress(spending_address) | ||
self.nodes[2].importaddress(staking_address) | ||
self.nodes[2].importaddress(coldstaking_address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you import both the spending/staking and the cold staking address, you can't discern if the txs are seen because the wallet is watching the cold staking address (which was already working) or because it is watching the spending/staking addresses (which were not working before). I'd suggest a setup with one node for each case.
@francisjyap any updates on this issue? |
@aguycalled @mxaddict So i found out what was causing the cold staking transactions from not appearing when importing a staking/spending address. Cold staking txs would only compare against addresses that are owned by the wallet and not against watched addresses. I also updated the test case. |
utACK
|
utACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working on Ubuntu 18.04
Full test suite + new test cases for this scenario also pass |
Tested OSX |
paid 5ab73dece539ab5a29b196a4af43e1834c9a5e35da1c977b92d71a005fb4feed |
Fix for importaddress returning incorrect amounts
This is for Issue #193