283 {
284 READWRITE(this->header);
285 READWRITE(this->nonce);
286
287 uint64_t shorttxids_size = (uint64_t)this->shorttxids.size();
288 READWRITE(COMPACTSIZE(shorttxids_size));
289 if (ser_action.ForRead()) {
290 size_t i = 0;
291 while (this->shorttxids.size() < shorttxids_size) {
292 this->shorttxids.resize(std::min(
293 (uint64_t)(1000 + this->shorttxids.size()), shorttxids_size));
294 for (; i < shorttxids.size(); i++) {
295 uint32_t lsb = 0;
296 uint16_t msb = 0;
297 READWRITE(lsb);
298 READWRITE(msb);
299 this->shorttxids[i] = (uint64_t(msb) << 32) | uint64_t(lsb);
300 }
301 }
302 } else {
303 for (size_t i = 0; i < this->shorttxids.size(); i++) {
304 uint32_t lsb = this->shorttxids[i] & 0xffffffff;
305 uint16_t msb = (this->shorttxids[i] >> 32) & 0xffff;
306 READWRITE(lsb);
307 READWRITE(msb);
308 }
309 }
310
311 READWRITE(this->prefilledtxn);
312
313 if (this->shorttxids.size() + this->prefilledtxn.size() >
314 std::numeric_limits<uint16_t>::max()) {
315 throw std::ios_base::failure("indexes overflowed 16 bits");
316 }
317 }