Changeset View
Changeset View
Standalone View
Standalone View
src/amount.h
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | public: | ||||
// ostream support | // ostream support | ||||
friend std::ostream &operator<<(std::ostream &stream, const Amount &ca) { | friend std::ostream &operator<<(std::ostream &stream, const Amount &ca) { | ||||
return stream << ca.amount; | return stream << ca.amount; | ||||
} | } | ||||
std::string ToString() const; | std::string ToString() const; | ||||
// serialization support | SERIALIZE_METHODS(Amount, obj) { READWRITE(obj.amount); } | ||||
ADD_SERIALIZE_METHODS; | |||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(amount); | |||||
} | |||||
}; | }; | ||||
static constexpr Amount SATOSHI = Amount::satoshi(); | static constexpr Amount SATOSHI = Amount::satoshi(); | ||||
static constexpr Amount CASH = 100 * SATOSHI; | static constexpr Amount CASH = 100 * SATOSHI; | ||||
static constexpr Amount COIN = 100000000 * SATOSHI; | static constexpr Amount COIN = 100000000 * SATOSHI; | ||||
/** | /** | ||||
* No amount larger than this (in satoshi) is valid. | * No amount larger than this (in satoshi) is valid. | ||||
Show All 14 Lines |