serialization: check stream good flag at the end
just in case
This commit is contained in:
parent
8ad9d0f618
commit
2fb6c1f80d
|
@ -320,7 +320,7 @@ namespace cryptonote
|
||||||
}
|
}
|
||||||
if (!typename Archive<W>::is_saving())
|
if (!typename Archive<W>::is_saving())
|
||||||
pruned = true;
|
pruned = true;
|
||||||
return true;
|
return ar.stream().good();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -256,7 +256,7 @@ namespace rct {
|
||||||
{
|
{
|
||||||
FIELD(type)
|
FIELD(type)
|
||||||
if (type == RCTTypeNull)
|
if (type == RCTTypeNull)
|
||||||
return true;
|
return ar.stream().good();
|
||||||
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
||||||
return false;
|
return false;
|
||||||
VARINT_FIELD(txnFee)
|
VARINT_FIELD(txnFee)
|
||||||
|
@ -316,7 +316,7 @@ namespace rct {
|
||||||
ar.delimit_array();
|
ar.delimit_array();
|
||||||
}
|
}
|
||||||
ar.end_array();
|
ar.end_array();
|
||||||
return true;
|
return ar.stream().good();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct rctSigPrunable {
|
struct rctSigPrunable {
|
||||||
|
@ -329,7 +329,7 @@ namespace rct {
|
||||||
bool serialize_rctsig_prunable(Archive<W> &ar, uint8_t type, size_t inputs, size_t outputs, size_t mixin)
|
bool serialize_rctsig_prunable(Archive<W> &ar, uint8_t type, size_t inputs, size_t outputs, size_t mixin)
|
||||||
{
|
{
|
||||||
if (type == RCTTypeNull)
|
if (type == RCTTypeNull)
|
||||||
return true;
|
return ar.stream().good();
|
||||||
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
||||||
return false;
|
return false;
|
||||||
if (type == RCTTypeSimpleBulletproof || type == RCTTypeFullBulletproof)
|
if (type == RCTTypeSimpleBulletproof || type == RCTTypeFullBulletproof)
|
||||||
|
@ -448,7 +448,7 @@ namespace rct {
|
||||||
}
|
}
|
||||||
ar.end_array();
|
ar.end_array();
|
||||||
}
|
}
|
||||||
return true;
|
return ar.stream().good();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -212,7 +212,7 @@ inline bool do_serialize(Archive &ar, bool &v)
|
||||||
* \brief self-explanatory
|
* \brief self-explanatory
|
||||||
*/
|
*/
|
||||||
#define END_SERIALIZE() \
|
#define END_SERIALIZE() \
|
||||||
return true; \
|
return ar.stream().good(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \macro VALUE(f)
|
/*! \macro VALUE(f)
|
||||||
|
|
Loading…
Reference in New Issue