mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
[Move Only] Put the asset definitions after COutPoint
This commit is contained in:
parent
f45ad32e01
commit
bdc49c987f
1 changed files with 40 additions and 40 deletions
|
|
@ -96,6 +96,46 @@ private: // "Bitcoin amounts" can only be set by deserializing with SERIALIZE_BI
|
|||
void SetToAmount(const CAmount nAmount);
|
||||
};
|
||||
|
||||
/** An outpoint - a combination of a transaction hash and an index n into its vout */
|
||||
class COutPoint
|
||||
{
|
||||
public:
|
||||
uint256 hash;
|
||||
uint32_t n;
|
||||
|
||||
COutPoint() { SetNull(); }
|
||||
COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; }
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(hash);
|
||||
READWRITE(n);
|
||||
}
|
||||
|
||||
void SetNull() { hash.SetNull(); n = (uint32_t) -1; }
|
||||
bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); }
|
||||
|
||||
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
int cmp = a.hash.Compare(b.hash);
|
||||
return cmp < 0 || (cmp == 0 && a.n < b.n);
|
||||
}
|
||||
|
||||
friend bool operator==(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
return (a.hash == b.hash && a.n == b.n);
|
||||
}
|
||||
|
||||
friend bool operator!=(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
std::string ToString() const;
|
||||
};
|
||||
|
||||
class CAssetGeneration
|
||||
{
|
||||
public:
|
||||
|
|
@ -146,46 +186,6 @@ public:
|
|||
// FIXME: constructor and methods
|
||||
};
|
||||
|
||||
/** An outpoint - a combination of a transaction hash and an index n into its vout */
|
||||
class COutPoint
|
||||
{
|
||||
public:
|
||||
uint256 hash;
|
||||
uint32_t n;
|
||||
|
||||
COutPoint() { SetNull(); }
|
||||
COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; }
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(hash);
|
||||
READWRITE(n);
|
||||
}
|
||||
|
||||
void SetNull() { hash.SetNull(); n = (uint32_t) -1; }
|
||||
bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); }
|
||||
|
||||
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
int cmp = a.hash.Compare(b.hash);
|
||||
return cmp < 0 || (cmp == 0 && a.n < b.n);
|
||||
}
|
||||
|
||||
friend bool operator==(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
return (a.hash == b.hash && a.n == b.n);
|
||||
}
|
||||
|
||||
friend bool operator!=(const COutPoint& a, const COutPoint& b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
std::string ToString() const;
|
||||
};
|
||||
|
||||
/** An input of a transaction. It contains the location of the previous
|
||||
* transaction's output that it claims and a signature that matches the
|
||||
* output's public key.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue