Add deserializing constructors to CTransaction and CMutableTransaction
This commit is contained in:
committed by
Jack Grigg
parent
40cc9aa7dd
commit
c7d71985c9
@@ -366,6 +366,7 @@ public:
|
||||
|
||||
/** Convert a CMutableTransaction into a CTransaction. */
|
||||
CTransaction(const CMutableTransaction &tx);
|
||||
CTransaction(CMutableTransaction &&tx);
|
||||
|
||||
CTransaction& operator=(const CTransaction& tx);
|
||||
|
||||
@@ -411,6 +412,9 @@ public:
|
||||
UpdateHash();
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
CTransaction(deserialize_type, Stream& s) : CTransaction(CMutableTransaction(deserialize, s)) {}
|
||||
|
||||
bool IsNull() const {
|
||||
return vin.empty() && vout.empty();
|
||||
}
|
||||
@@ -523,6 +527,11 @@ struct CMutableTransaction
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
CMutableTransaction(deserialize_type, Stream& s) {
|
||||
Unserialize(s);
|
||||
}
|
||||
|
||||
/** Compute the hash of this CMutableTransaction. This is computed on the
|
||||
* fly, as opposed to GetHash() in CTransaction, which uses a cached result.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user