44 if (
nSequence != std::numeric_limits<unsigned int>::max())
83 if (
vin.size() != old.
vin.size())
85 for (
unsigned int i = 0; i <
vin.size(); i++)
86 if (
vin[i].prevout != old.
vin[i].prevout)
90 unsigned int nLowest = std::numeric_limits<unsigned int>::max();
91 for (
unsigned int i = 0; i <
vin.size(); i++)
93 if (
vin[i].nSequence != old.
vin[i].nSequence)
95 if (
vin[i].nSequence <= nLowest)
98 nLowest =
vin[i].nSequence;
100 if (old.
vin[i].nSequence < nLowest)
103 nLowest = old.
vin[i].nSequence;
112 int64_t nValueOut = 0;
115 nValueOut += txout.
nValue;
117 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range");
131 BOOST_FOREACH(
const CTxIn& txin,
vin)
133 unsigned int offset = 41U + std::min(110U, (
unsigned int)txin.
scriptSig.size());
134 if (nTxSize > offset)
137 if (nTxSize == 0)
return 0.0;
138 return dPriorityInputs / nTxSize;
144 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
150 for (
unsigned int i = 0; i <
vin.size(); i++)
152 for (
unsigned int i = 0; i <
vout.size(); i++)
176 while (((n % 10) == 0) && e < 9) {
182 assert(d >= 1 && d <= 9);
184 return 1 + (n*9 + d - 1)*10 + e;
186 return 1 + (n - 1)*10 + 9;
234 for (
int nSize =
vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
236 for (
int i = 0; i < nSize; i += 2)
238 int i2 = std::min(i+1, nSize-1);
251 std::vector<uint256> vMerkleBranch;
253 for (
int nSize =
vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
255 int i = std::min(nIndex^1, nSize-1);
260 return vMerkleBranch;
267 BOOST_FOREACH(
const uint256& otherside, vMerkleBranch)
280 LogPrintf(
"CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
287 for (
unsigned int i = 0; i <
vtx.size(); i++)
293 for (
unsigned int i = 0; i <
vMerkleTree.size(); i++)
int64_t GetValueOut() const
double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const
bool MoneyRange(int64_t nValue)
std::string ToString() const
bool IsNewerThan(const CTransaction &old) const
std::string ToString() const
uint256 BuildMerkleTree() const
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
std::vector< uint256 > GetMerkleBranch(int nIndex) const
unsigned int GetSerializeSize(char a, int, int=0)
An input of a transaction.
std::vector< CTxOut > vout
void scrypt_1024_1_1_256(const char *input, char *output)
std::vector< uint256 > vMerkleTree
uint256 Hash(const T1 pbegin, const T1 pend)
An output of a transaction.
static uint64_t CompressAmount(uint64_t nAmount)
An outpoint - a combination of a transaction hash and an index n into its vout.
std::string ToString() const
std::string ToString() const
static uint64_t DecompressAmount(uint64_t nAmount)
std::string ToString() const
Serialized script, used inside transaction inputs and outputs.
std::string ToString() const
static uint256 CheckMerkleBranch(uint256 hash, const std::vector< uint256 > &vMerkleBranch, int nIndex)
std::vector< CTransaction > vtx
The basic transaction that is broadcasted on the network and contained in blocks. ...
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)