Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ismine.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2016 The Starwels developers
  3. // Distributed under the MIT software license, see the accompanying
  4. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. #ifndef STARWELS_SCRIPT_ISMINE_H
  6. #define STARWELS_SCRIPT_ISMINE_H
  7. #include "script/standard.h"
  8. #include <stdint.h>
  9. class CKeyStore;
  10. class CScript;
  11. /** IsMine() return codes */
  12. enum isminetype
  13. {
  14. ISMINE_NO = 0,
  15. //! Indicates that we don't know how to create a scriptSig that would solve this if we were given the appropriate private keys
  16. ISMINE_WATCH_UNSOLVABLE = 1,
  17. //! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys
  18. ISMINE_WATCH_SOLVABLE = 2,
  19. ISMINE_WATCH_ONLY = ISMINE_WATCH_SOLVABLE | ISMINE_WATCH_UNSOLVABLE,
  20. ISMINE_SPENDABLE = 4,
  21. ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE
  22. };
  23. /** used for bitflags of isminetype */
  24. typedef uint8_t isminefilter;
  25. /* isInvalid becomes true when the script is found invalid by consensus or policy. This will terminate the recursion
  26. * and return a ISMINE_NO immediately, as an invalid script should never be considered as "mine". This is needed as
  27. * different SIGVERSION may have different network rules. Currently the only use of isInvalid is indicate uncompressed
  28. * keys in SIGVERSION_WITNESS_V0 script, but could also be used in similar cases in the future
  29. */
  30. isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid, SigVersion = SIGVERSION_BASE);
  31. isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, SigVersion = SIGVERSION_BASE);
  32. isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, bool& isInvalid, SigVersion = SIGVERSION_BASE);
  33. isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, SigVersion = SIGVERSION_BASE);
  34. #endif // STARWELS_SCRIPT_ISMINE_H