 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
59 if (
nSequence != std::numeric_limits<unsigned int>::max())
77 return (
n == tx->
vout.size() - 1) && (tx->
vout[1].scriptPubKey != tx->
vout[
n].scriptPubKey);
91 CMutableTransaction::CMutableTransaction(
const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime), txPrivM(tx.txPrivM), hasPaymentID(tx.hasPaymentID), paymentID(tx.paymentID), txType(tx.txType), bulletproofs(tx.bulletproofs), nTxFee(tx.nTxFee), c(tx.c),
S(tx.
S), ntxFeeKeyImage(tx.ntxFeeKeyImage) {}
101 str +=
strprintf(
"CMutableTransaction(ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
106 for (
unsigned int i = 0; i <
vin.size(); i++)
108 for (
unsigned int i = 0; i <
vout.size(); i++)
120 CTransaction::CTransaction(
const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime), hasPaymentID(tx.hasPaymentID), paymentID(tx.paymentID), txType(tx.txType), bulletproofs(tx.bulletproofs), nTxFee(tx.nTxFee), c(tx.c),
S(tx.
S), ntxFeeKeyImage(tx.ntxFeeKeyImage) {
126 *
const_cast<std::vector<CTxIn>*
>(&
vin) = tx.
vin;
127 *
const_cast<std::vector<CTxOut>*
>(&
vout) = tx.
vout;
149 if (
vin[0].prevout.IsNull())
152 return (
vin.size() > 0 && (!
vin[0].prevout.IsNull() &&
vin[0].decoys.empty()) &&
vout.size() >= 2 &&
vout[0].IsEmpty());
158 for (std::vector<CTxOut>::const_iterator it(
vout.begin()); it !=
vout.end(); ++it)
162 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range : less than 0");
164 if ((nValueOut + it->nValue) < nValueOut)
165 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range : wraps the int64_t boundary");
175 if (in.prevout == out)
184 std::list<COutPoint> listOutPoints;
186 for (
unsigned int i = 0; i <
vout.size(); i++)
187 listOutPoints.emplace_back(
COutPoint(txHash, i));
188 return listOutPoints;
194 if (nTxSize == 0)
return 0.0;
196 return (dPriorityInputs +
nTxFee * 1000) / nTxSize;
208 for (std::vector<CTxIn>::const_iterator it(
vin.begin()); it !=
vin.end(); ++it)
210 unsigned int offset = 41U + std::min(110U, (
unsigned int)it->scriptSig.size());
211 if (nTxSize > offset)
221 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
227 for (
unsigned int i = 0; i <
vin.size(); i++)
229 for (
unsigned int i = 0; i <
vout.size(); i++)
An input of a transaction.
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
#define BEGIN(a)
Utilities for converting data from/to strings.
std::vector< std::vector< uint256 > > S
std::string ToStringShort() const
unsigned int GetSerializeSize(char a, int, int=0)
CAmount GetValueOut() const
bool IsMasternodeReward(const CTransaction *tx) const
The basic transaction that is broadcasted on the network and contained in blocks.
bool UsesUTXO(const COutPoint out)
std::list< COutPoint > GetOutPoints() const
std::vector< CTxOut > vout
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
int64_t CAmount
Amount in PRCY (Can be negative)
bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
256-bit unsigned big integer.
CTransaction()
Construct a CTransaction that qualifies as IsNull()
Serialized script, used inside transaction inputs and outputs.
std::vector< CTxOut > vout
std::string ToString() const
std::vector< unsigned char > bulletproofs
An encapsulated private key.
std::string ToString() const
std::string ToString() const
std::string ToString() const
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const
std::string ToString() const
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.
std::string Hash(std::string input)
Compute the 256-bit hash of a std::string.
A mutable version of CTransaction.
double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const
const uint256 hash
Memory only.
#define S(x0, x1, x2, x3, cb, r)
std::string ToString() const