mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge #9039: Various serialization simplifcations and optimizations
d59a518Use fixed preallocation instead of costly GetSerializeSize (Pieter Wuille)25a211aAdd optimized CSizeComputer serializers (Pieter Wuille)a2929a2Make CSerAction's ForRead() constexpr (Pieter Wuille)a603925Avoid -Wshadow errors (Pieter Wuille)5284721Get rid of nType and nVersion (Pieter Wuille)657e05aMake GetSerializeSize a wrapper on top of CSizeComputer (Pieter Wuille)fad9b66Make nType and nVersion private and sometimes const (Pieter Wuille)c2c5d42Make streams' read and write return void (Pieter Wuille)50e8a9cRemove unused ReadVersion and WriteVersion (Pieter Wuille)
This commit is contained in:
commit
e81df49644
39 changed files with 409 additions and 543 deletions
|
|
@ -1712,7 +1712,7 @@ bool WriteBlockToDisk(const CBlock& block, CDiskBlockPos& pos, const CMessageHea
|
|||
return error("WriteBlockToDisk: OpenBlockFile failed");
|
||||
|
||||
// Write index header
|
||||
unsigned int nSize = fileout.GetSerializeSize(block);
|
||||
unsigned int nSize = GetSerializeSize(fileout, block);
|
||||
fileout << FLATDATA(messageStart) << nSize;
|
||||
|
||||
// Write block
|
||||
|
|
@ -2102,7 +2102,7 @@ bool UndoWriteToDisk(const CBlockUndo& blockundo, CDiskBlockPos& pos, const uint
|
|||
return error("%s: OpenUndoFile failed", __func__);
|
||||
|
||||
// Write index header
|
||||
unsigned int nSize = fileout.GetSerializeSize(blockundo);
|
||||
unsigned int nSize = GetSerializeSize(fileout, blockundo);
|
||||
fileout << FLATDATA(messageStart) << nSize;
|
||||
|
||||
// Write undo data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue