Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Add wallet height to bottom toolbar #912

Merged
merged 4 commits into from
Mar 14, 2019
Merged

Add wallet height to bottom toolbar #912

merged 4 commits into from
Mar 14, 2019

Conversation

hal0x2328
Copy link
Member

What current issue(s) does this address, or what feature is it adding?
Monitoring wallet height requires getting all the wallet info which can be slow depending on how many address/tokens/contracts exist in the wallet

How did you solve this problem?
Added the current wallet height to the bottom toolbar in the same format neo-cli uses (wallet height/db height/blockchain height)

How did you make sure your solution works?
Manual testing

Are there any special changes in the code that we should be aware of?
No
Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

@hal0x2328
Copy link
Member Author

Wallet._current_height seems to always be one higher than the db/blockchain heights. Does this track? Should I modify the height to subtract 1 for display purposes to avoid confusion?

@coveralls
Copy link

coveralls commented Mar 14, 2019

Coverage Status

Coverage remained the same at 86.571% when pulling 340fe3a on hal0x2328:development into b8105d0 on CityOfZion:development.

@ixje
Copy link
Member

ixje commented Mar 14, 2019

I actually encountered this issue yesterday as well in my asyncio branch.
If you could change this

while self._current_height <= Blockchain.Default().Height and (block_limit == 0 or blockcount < block_limit):
block = Blockchain.Default().GetBlockByHeight(self._current_height)
if block is not None:
self.ProcessNewBlock(block)
else:
self._current_height += 1
blockcount += 1

to this

            while self._current_height < Blockchain.Default().Height and (block_limit == 0 or blockcount < block_limit):

                block = Blockchain.Default().GetBlockByHeight(self._current_height)

                if block is not None:
                    self.ProcessNewBlock(block)
                else:
                    break

                blockcount += 1

and a single wallet rebuild will be enough

at least that way we avoid confusion when looking at the toolbar code

Copy link
Member

@ixje ixje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

@hal0x2328
Copy link
Member Author

Ok, made the requested change

@ixje ixje merged commit dc869a7 into CityOfZion:development Mar 14, 2019
@ixje
Copy link
Member

ixje commented Mar 14, 2019

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants