![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include "script/interpreter.h"#include "uint256.h"#include <boost/variant.hpp>#include <stdint.h>Go to the source code of this file.
Classes | |
| class | CScriptID |
| A reference to a CScript: the Hash160 of its serialization (see script.h) More... | |
| class | CNoDestination |
Typedefs | |
| typedef boost::variant< CNoDestination, CKeyID, CScriptID, CExchangeKeyID > | CTxDestination |
| A txout script template with a specific destination. More... | |
Enumerations | |
| enum | txnouttype { TX_NONSTANDARD , TX_PUBKEY , TX_PUBKEYHASH , TX_SCRIPTHASH , TX_MULTISIG , TX_NULL_DATA , TX_COLDSTAKE , TX_EXCHANGEADDR } |
Functions | |
| bool | IsValidDestination (const CTxDestination &dest) |
| Check whether a CTxDestination is a CNoDestination. More... | |
| const char * | GetTxnOutputType (txnouttype t) |
| bool | Solver (const CScript &scriptPubKey, txnouttype &typeRet, std::vector< std::vector< unsigned char > > &vSolutionsRet) |
| Parse a scriptPubKey and identify script type for standard scripts. More... | |
| bool | ExtractDestination (const CScript &scriptPubKey, CTxDestination &addressRet, bool fColdStake=false) |
| Parse a standard scriptPubKey for the destination address. More... | |
| bool | ExtractDestinations (const CScript &scriptPubKey, txnouttype &typeRet, std::vector< CTxDestination > &addressRet, int &nRequiredRet) |
| Parse a standard scriptPubKey with one or more destination addresses. More... | |
| CScript | GetScriptForDestination (const CTxDestination &dest) |
| Generate a PIVX scriptPubKey for the given CTxDestination. More... | |
| CScript | GetScriptForRawPubKey (const CPubKey &pubkey) |
| Generate a P2PK script for the given pubkey. More... | |
| CScript | GetScriptForMultisig (int nRequired, const std::vector< CPubKey > &keys) |
| Generate a multisig script. More... | |
| CScript | GetScriptForStakeDelegation (const CKeyID &stakingKey, const CKeyID &spendingKey) |
| Generate a P2CS script for the given staker and owner keys. More... | |
| CScript | GetScriptForStakeDelegationLOF (const CKeyID &stakingKey, const CKeyID &spendingKey) |
| CScript | GetScriptForOpReturn (const uint256 &message) |
| Generate an OP_RETURN output script with the given data. More... | |
Variables | |
| unsigned | nMaxDatacarrierBytes |
| typedef boost::variant<CNoDestination, CKeyID, CScriptID, CExchangeKeyID> CTxDestination |
A txout script template with a specific destination.
It is either:
Definition at line 72 of file standard.h.
| enum txnouttype |
| Enumerator | |
|---|---|
| TX_NONSTANDARD | |
| TX_PUBKEY | |
| TX_PUBKEYHASH | |
| TX_SCRIPTHASH | |
| TX_MULTISIG | |
| TX_NULL_DATA | |
| TX_COLDSTAKE | |
| TX_EXCHANGEADDR | |
Definition at line 45 of file standard.h.
| bool ExtractDestination | ( | const CScript & | scriptPubKey, |
| CTxDestination & | addressRet, | ||
| bool | fColdStake = false |
||
| ) |
Parse a standard scriptPubKey for the destination address.
Assigns result to the addressRet parameter and returns true if successful. For multisig scripts, instead use ExtractDestinations. Currently only works for P2PK, P2PKH, P2SH and P2CS scripts.
Definition at line 162 of file standard.cpp.
| bool ExtractDestinations | ( | const CScript & | scriptPubKey, |
| txnouttype & | typeRet, | ||
| std::vector< CTxDestination > & | addressRet, | ||
| int & | nRequiredRet | ||
| ) |
Parse a standard scriptPubKey with one or more destination addresses.
For multisig scripts, this populates the addressRet vector with the pubkey IDs and nRequiredRet with the n required to spend. For P2CS addressRet is populated with the staker and owner IDs and nRequiredRet is set to 2. For other destinations, addressRet is populated with a single value and nRequiredRet is set to 1. Returns true if successful.
Definition at line 195 of file standard.cpp.
| CScript GetScriptForDestination | ( | const CTxDestination & | dest | ) |
Generate a PIVX scriptPubKey for the given CTxDestination.
Returns a P2PKH script for a CKeyID destination, a P2SH script for a CScriptID, and an empty script for CNoDestination.
Definition at line 278 of file standard.cpp.
Generate a multisig script.
Definition at line 311 of file standard.cpp.
Generate an OP_RETURN output script with the given data.
Definition at line 322 of file standard.cpp.
Generate a P2PK script for the given pubkey.
Definition at line 286 of file standard.cpp.
Generate a P2CS script for the given staker and owner keys.
Definition at line 291 of file standard.cpp.
Definition at line 301 of file standard.cpp.
| const char* GetTxnOutputType | ( | txnouttype | t | ) |
| bool IsValidDestination | ( | const CTxDestination & | dest | ) |
Check whether a CTxDestination is a CNoDestination.
Definition at line 329 of file standard.cpp.
| bool Solver | ( | const CScript & | scriptPubKey, |
| txnouttype & | typeRet, | ||
| std::vector< std::vector< unsigned char > > & | vSolutionsRet | ||
| ) |
Parse a scriptPubKey and identify script type for standard scripts.
If successful, returns script type and parsed pubkeys or hashes, depending on the type. For example, for a P2SH script, vSolutionsRet will contain the script hash, for P2PKH it will contain the key hash, etc.
| [in] | scriptPubKey | Script to parse |
| [out] | typeRet | The script type |
| [out] | vSolutionsRet | Vector of parsed pubkeys and hashes |
Definition at line 90 of file standard.cpp.
|
extern |
Definition at line 14 of file standard.cpp.