43 if (
nSequence != std::numeric_limits<unsigned int>::max())
82 if (
vin.size() != old.
vin.size())
84 for (
unsigned int i = 0; i <
vin.size(); i++)
85 if (
vin[i].prevout != old.
vin[i].prevout)
89 unsigned int nLowest = std::numeric_limits<unsigned int>::max();
90 for (
unsigned int i = 0; i <
vin.size(); i++)
92 if (
vin[i].nSequence != old.
vin[i].nSequence)
94 if (
vin[i].nSequence <= nLowest)
97 nLowest =
vin[i].nSequence;
99 if (old.
vin[i].nSequence < nLowest)
102 nLowest = old.
vin[i].nSequence;
111 int64_t nValueOut = 0;
114 nValueOut += txout.
nValue;
116 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range");
130 BOOST_FOREACH(
const CTxIn& txin,
vin)
132 unsigned int offset = 41U + std::min(110U, (
unsigned int)txin.
scriptSig.size());
133 if (nTxSize > offset)
136 if (nTxSize == 0)
return 0.0;
137 return dPriorityInputs / nTxSize;
143 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
149 for (
unsigned int i = 0; i <
vin.size(); i++)
151 for (
unsigned int i = 0; i <
vout.size(); i++)
175 while (((n % 10) == 0) && e < 9) {
181 assert(d >= 1 && d <= 9);
183 return 1 + (n*9 + d - 1)*10 + e;
185 return 1 + (n - 1)*10 + 9;
226 for (
int nSize =
vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
228 for (
int i = 0; i < nSize; i += 2)
230 int i2 = std::min(i+1, nSize-1);
243 std::vector<uint256> vMerkleBranch;
245 for (
int nSize =
vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
247 int i = std::min(nIndex^1, nSize-1);
252 return vMerkleBranch;
259 BOOST_FOREACH(
const uint256& otherside, vMerkleBranch)
272 LogPrintf(
"CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
279 for (
unsigned int i = 0; i <
vtx.size(); i++)
285 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
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
static const int64_t COIN
Serialized script, used inside transaction inputs and outputs.
std::string ToString() const
static const int PROTOCOL_VERSION
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)