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

Refactor Util.isTokenUtxo() #87

Open
christroutner opened this issue Jan 14, 2020 · 0 comments
Open

Refactor Util.isTokenUtxo() #87

christroutner opened this issue Jan 14, 2020 · 0 comments
Labels
Ready Issue is actionable

Comments

@christroutner
Copy link
Contributor

The scope of this Issue is to refactor Util.isTokenUtxos() to match the refactoring done to tokenUtxoDetails() in PR #86. The new behavior of this function will return confident false or true. It will only return null if SLPDB has not processed the UTXO yet and has not yet made a determination of its validity.

The workflow for this refactor is as follows:

  • For each UTXO, retrieve the raw transaction data from the full node.
  • If there is no OP_RETURN in the TX, then the UTXO can be marked as false.
  • If there is an OP_RETURN, attempt to decode it. If it can't be decoded, then the UTXO can be marked as false.
  • If the OP_RETURN can be decoded as an SLP transaction, then the txid is validated with SLPDB.
  • If SLPDB returns null, it means it has not yet processed the utxo. The UTXO should be marked as null to communicate this.
  • Otherwise the UTXO can be marked true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready Issue is actionable
Projects
None yet
Development

No branches or pull requests

1 participant