dcrjson: Ready GetStakeInfoResult for SPV wallets. #1333
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes the following fields omitempty so they can be
ignored by SPV wallets:
As a side-effect, non-SPV wallets will also omit these fields from the
result if the value is zero.
The following counts remain:
And two new fields have been added to allow SPV wallets to provide a
fuller picture of the wallet's ticket state counts:
The
unspent
field describes the number of tickets that have gonelive and have not been spent by a vote or revocation. The
unspentexpired
field describes the number of unspent tickets thatmust certainly be revoked as they have not been spent by a vote and
have passed the expiry period. These tickets may have been called and
missed, or actually expired, but a SPV wallet is aware that they must
be revoked as they cannot possibly be live.
These changes are being made due to SPV wallets being unaware of what
state a matured ticket is in (whether live, picked, or missed) and
because SPV wallets do not know the ticket pool size or the number of
all unmined tickets.