In commit “Convert blockencodings.h to new serialization framework” (d46dfeccaf1992ba92bff7e0d4988ae3f66b327a)
Maybe a matter of preference, but it might be nice to avoid needing to repeat s << header... ss >> header... serialization order. Could do:
0SERIALIZE_METHODS(CBlockHeaderAndShortTxIDs, obj)
1{
2 static_assert(SHORTTXIDS_LENGTH == 6, "shorttxids serialization assumes 6-byte shorttxids");
3 READWRITE(obj.header, obj.nonce, Using<VectorFormatter<Uint48Formatter>>(obj.shorttxids), obj.prefilledtxn);
4 if (ser_action.ForRead()) {
5 if (obj.BlockTxCount() > std::numeric_limits<uint16_t>::max()) {
6 throw std::ios_base::failure("indexes overflowed 16 bits");
7 }
8 obj.FillShortTxIDSelector();
9 }
10}