Skip to content
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

dcrjson: Ready GetStakeInfoResult for SPV wallets. #1333

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

jrick
Copy link
Member

@jrick jrick commented Jul 3, 2018

This change makes the following fields omitempty so they can be
ignored by SPV wallets:

  • poolsize
  • allmempooltix
  • live
  • proportionlive
  • missed
  • proportionmissed
  • expired

As a side-effect, non-SPV wallets will also omit these fields from the
result if the value is zero.

The following counts remain:

  • ownmempooltix
  • immature
  • voted
  • revoked

And two new fields have been added to allow SPV wallets to provide a
fuller picture of the wallet's ticket state counts:

  • unspent
  • unspentexpired

The unspent field describes the number of tickets that have gone
live and have not been spent by a vote or revocation. The
unspentexpired field describes the number of unspent tickets that
must 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.

This change makes the following fields omitempty so they can be
ignored by SPV wallets:

 * poolsize
 * allmempooltix
 * live
 * proportionlive
 * missed
 * proportionmissed
 * expired

As a side-effect, non-SPV wallets will also omit these fields from the
result if the value is zero.

The following counts remain:

 * ownmempooltix
 * immature
 * voted
 * revoked

And two new fields have been added to allow SPV wallets to provide a
fuller picture of the wallet's ticket state counts:

 * unspent
 * unspentexpired

The `unspent` field describes the number of tickets that have gone
live and have not been spent by a vote or revocation.  The
`unspentexpired` field describes the number of unspent tickets that
must 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.
@davecgh davecgh merged commit e62476c into decred:master Jul 3, 2018
@jrick jrick deleted the spvstakeinfo branch July 3, 2018 16:02
@davecgh davecgh added this to the 1.3.0 milestone Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants