 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
8 #ifndef BITCOIN_PRIMITIVES_TRANSACTION_H
9 #define BITCOIN_PRIMITIVES_TRANSACTION_H
30 static void Decode(
unsigned char* encodedMask,
unsigned char* encodedAmount,
const CPubKey& sharedSec,
CKey& decodedMask,
CAmount& decodedAmount);
47 template <
typename Stream,
typename Operation>
48 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
59 return (a.
hash <
b.hash || (a.
hash ==
b.hash && a.
n <
b.n));
64 return (a.
hash ==
b.hash && a.
n ==
b.n);
90 std::vector<unsigned char>
s;
91 std::vector<unsigned char>
R;
103 nSequence = std::numeric_limits<unsigned int>::max();
107 CTxIn(
uint256 hashPrevTx, uint32_t nOut,
CScript scriptSigIn=
CScript(), uint32_t nSequenceIn=std::numeric_limits<uint32_t>::max());
111 template <
typename Stream,
typename Operation>
126 return (
nSequence == std::numeric_limits<uint32_t>::max());
189 template <
typename Stream,
typename Operation>
190 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
242 return (a.
nValue ==
b.nValue &&
301 std::vector<std::vector<uint256>>
S;
316 template <
typename Stream,
typename Operation>
318 READWRITE(*
const_cast<int32_t*
>(&this->nVersion));
334 if (ser_action.ForRead())
339 return vin.empty() &&
vout.empty();
351 double ComputePriority(
double dPriorityInputs,
unsigned int nTxSize=0)
const;
361 return (
vin.size() == 1 &&
vin[0].prevout.IsNull());
366 return (
vin.size() == 1 &&
vin[0].prevout.IsNull());
373 return a.
hash ==
b.hash;
378 return a.
hash !=
b.hash;
399 std::vector<std::vector<uint256>>
S;
407 template <
typename Stream,
typename Operation>
452 *
const_cast<std::vector<CTxIn>*
>(&
vin) = tx.
vin;
453 *
const_cast<std::vector<CTxOut>*
>(&
vout) = tx.
vout;
461 for (
size_t i = 0; i <
vout.size(); i++) {
468 template <
typename Stream,
typename Operation>
512 template <
typename Stream,
typename Operation>
513 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
527 #endif // BITCOIN_PRIMITIVES_TRANSACTION_H
An input of a transaction.
friend bool operator<(const COutPoint &a, const COutPoint &b)
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
std::vector< unsigned char > encryptionKey
CFeeRate minRelayTxFee
Fees smaller than this (in duffs) are considered zero fee (for relaying and mining) We are ~100 times...
static void Encode(const CKey &mask, const CAmount &amount, const CPubKey &sharedSec, uint256 &encodedMask, uint256 &encodedAmount)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
friend bool operator!=(const CTxOut &a, const CTxOut &b)
friend bool operator==(const COutPoint &a, const COutPoint &b)
std::vector< std::vector< uint256 > > S
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::string ToStringShort() const
friend bool operator!=(const CTransaction &a, const CTransaction &b)
bool IsDust(CFeeRate minRelayTxFee) const
unsigned int GetSerializeSize(char a, int, int=0)
CAmount GetValueOut() const
Fee rate in PRCY per kilobyte: CAmount / kB.
bool IsMasternodeReward(const CTransaction *tx) const
std::vector< unsigned char > encryptionKey
std::vector< unsigned char > masternodeStealthAddress
The basic transaction that is broadcasted on the network and contained in blocks.
std::vector< unsigned char > bulletproofs
bool UsesUTXO(const COutPoint out)
friend bool operator!=(const CTxIn &a, const CTxIn &b)
std::list< COutPoint > GetOutPoints() const
COutPoint(uint256 hashIn, uint32_t nIn)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
An output of a transaction.
std::vector< CTxOut > vout
void ecdhDecode(uint256 &masked, uint256 &amount, const unsigned char *sharedSec, int size)
std::vector< unsigned char > masternodeStealthAddress
std::vector< unsigned char > txPriv
CTransactionSignature(const CTransaction &tx)
friend bool operator==(const CTxIn &a, const CTxIn &b)
std::vector< CTxOut > vout
int64_t CAmount
Amount in PRCY (Can be negative)
std::vector< unsigned char > R
friend bool operator!=(const COutPoint &a, const COutPoint &b)
std::vector< COutPoint > decoys
std::vector< unsigned char > masternodeStealthAddress
struct MaskValue MaskValue
256-bit unsigned big integer.
CTransaction()
Construct a CTransaction that qualifies as IsNull()
Serialized script, used inside transaction inputs and outputs.
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
static void ComputeSharedSec(const CKey &priv, const CPubKey &pubKey, CPubKey &sharedSec)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
static const int32_t CURRENT_VERSION
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
std::vector< CTxOut > vout
friend bool operator==(const CTransaction &a, const CTransaction &b)
An encapsulated public key.
std::string ToString() const
std::vector< unsigned char > bulletproofs
An encapsulated private key.
std::string ToString() const
std::vector< unsigned char > s
friend bool operator==(const CTxOut &a, const CTxOut &b)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::string ToString() const
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const
std::string ToString() const
std::vector< unsigned char > commitment
std::string ToString() const
const uint256 & GetHash() const
An outpoint - a combination of a transaction hash and an index n into its vout.
CTransaction & operator=(const CTransaction &tx)
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
A mutable version of CTransaction.
CAmount GetFee(size_t size) const
double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const
CTxInShortDigest(const CTxIn &in)
const uint256 hash
Memory only.
std::vector< unsigned char > txPub
std::vector< std::vector< uint256 > > S
void ecdhEncode(uint256 &unmasked, uint256 &amount, const unsigned char *sharedSec, int size)
static void Decode(unsigned char *encodedMask, unsigned char *encodedAmount, const CPubKey &sharedSec, CKey &decodedMask, CAmount &decodedAmount)