31 void SetNull() { hash = 0; n = (
unsigned int) -1; }
32 bool IsNull()
const {
return (hash == 0 && n == (
unsigned int) -1); }
63 bool IsNull()
const {
return (ptx == NULL && n == (
unsigned int) -1); }
79 nSequence = std::numeric_limits<unsigned int>::max();
83 CTxIn(
uint256 hashPrevTx,
unsigned int nOut,
CScript scriptSigIn=
CScript(),
unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max());
94 return (nSequence == std::numeric_limits<unsigned int>::max());
141 scriptPubKey.clear();
146 return (nValue == -1);
151 bool IsDust(int64_t nMinRelayTxFee)
const
218 return (vin.empty() && vout.empty());
230 double ComputePriority(
double dPriorityInputs,
unsigned int nTxSize=0)
const;
234 return (vin.size() == 1 && vin[0].prevout.IsNull());
295 CTxInUndo() : txout(), fCoinBase(false), nHeight(0), nVersion(0) {}
296 CTxInUndo(
const CTxOut &txoutIn,
bool fCoinBaseIn =
false,
unsigned int nHeightIn = 0,
int nVersionIn = 0) : txout(txoutIn), fCoinBase(fCoinBaseIn), nHeight(nHeightIn), nVersion(nVersionIn) { }
304 template<
typename Stream>
305 void Serialize(Stream &s,
int nType,
int nVersion)
const {
312 template<
typename Stream>
314 unsigned int nCode = 0;
317 fCoinBase = nCode & 1;
348 static const int CURRENT_VERSION=2;
364 nVersion = this->nVersion;
391 return (int64_t)nTime;
400 std::vector<CTransaction>
vtx;
424 CBlockHeader::SetNull();
441 uint256 BuildMerkleTree()
const;
444 assert(vMerkleTree.size() > 0);
445 assert(nIndex < vtx.size());
446 return vMerkleTree[nIndex];
449 std::vector<uint256> GetMerkleBranch(
int nIndex)
const;
450 static uint256 CheckMerkleBranch(
uint256 hash,
const std::vector<uint256>& vMerkleBranch,
int nIndex);
484 return vHave.empty();
bool IsDust(int64_t nMinRelayTxFee) const
int64_t GetValueOut() const
friend bool operator!=(const COutPoint &a, const COutPoint &b)
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const
CBlock(const CBlockHeader &header)
wrapper for CTxOut that provides a more compact serialization
unsigned int GetSerializeSize(int nType, int nVersion) const
void Serialize(Stream &s, char a, int, int=0)
friend bool operator==(const CTxOut &a, const CTxOut &b)
IMPLEMENT_SERIALIZE(READWRITE(prevout);READWRITE(scriptSig);READWRITE(nSequence);) bool IsFinal() const
bool MoneyRange(int64_t nValue)
#define IMPLEMENT_SERIALIZE(statements)
Compact serializer for scripts.
friend bool operator!=(const CTxOut &a, const CTxOut &b)
CTxOutCompressor(CTxOut &txoutIn)
static int64_t nMinTxFee
Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) ...
Undo information for a CTxIn.
std::string ToString() const
bool IsNewerThan(const CTransaction &old) const
friend bool operator==(const COutPoint &a, const COutPoint &b)
IMPLEMENT_SERIALIZE(READWRITE(this->nVersion);nVersion=this->nVersion;READWRITE(vin);READWRITE(vout);READWRITE(nLockTime);) void SetNull()
void Serialize(Stream &s, int nType, int nVersion) const
unsigned int GetSerializeSize(char a, int, int=0)
An input of a transaction.
std::vector< CTxOut > vout
void Unserialize(Stream &s, char &a, int, int=0)
CBlockHeader GetBlockHeader() const
CInPoint(const CTransaction *ptxIn, unsigned int nIn)
std::vector< uint256 > vMerkleTree
An output of a transaction.
std::vector< uint256 > vHave
static uint64_t CompressAmount(uint64_t nAmount)
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxInUndo > vprevout
CBlockLocator(const std::vector< uint256 > &vHaveIn)
std::string ToString() const
std::string ToString() const
IMPLEMENT_SERIALIZE(READWRITE(FLATDATA(*this));) void SetNull()
const uint256 & GetTxHash(unsigned int nIndex) const
COutPoint(uint256 hashIn, unsigned int nIn)
static uint64_t DecompressAmount(uint64_t nAmount)
std::string ToString() const
IMPLEMENT_SERIALIZE(READWRITE(nValue);READWRITE(scriptPubKey);) void SetNull()
static const int64_t COIN
void Unserialize(Stream &s, int nType, int nVersion)
Serialized script, used inside transaction inputs and outputs.
Undo information for a CTransaction.
An inpoint - a combination of a transaction and an index n into its vin.
static int64_t nMinRelayTxFee
Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) ...
std::vector< CTransaction > vtx
friend bool operator<(const COutPoint &a, const COutPoint &b)
The basic transaction that is broadcasted on the network and contained in blocks. ...
static const int CURRENT_VERSION
friend bool operator==(const CTxIn &a, const CTxIn &b)
CTxInUndo(const CTxOut &txoutIn, bool fCoinBaseIn=false, unsigned int nHeightIn=0, int nVersionIn=0)
friend bool operator!=(const CTxIn &a, const CTxIn &b)
friend bool operator==(const CTransaction &a, const CTransaction &b)
friend bool operator!=(const CTransaction &a, const CTransaction &b)
static const int64_t MAX_MONEY
No amount larger than this (in satoshi) is valid.