@@ -622,7 +622,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(c
622622 // have been mined or received.
623623 // 10,000 orphans, each of which is at most 5,000 bytes big is
624624 // at most 500 megabytes of orphans:
625- unsigned int sz = tx.GetSerializeSize (SER_NETWORK, CTransaction::CURRENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
625+ unsigned int sz = tx.GetSerializeSize (SER_NETWORK, CTransaction::CURRENT_VERSION);
626626 if (sz > 5000 )
627627 {
628628 LogPrint (" mempool" , " ignoring large orphan tx (size: %u, hash: %s)\n " , sz, hash.ToString ());
@@ -1487,7 +1487,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P
14871487 if (fTxIndex ) {
14881488 CDiskTxPos postx;
14891489 if (pblocktree->ReadTxIndex (hash, postx)) {
1490- CAutoFile file (OpenBlockFile (postx, true ), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
1490+ CAutoFile file (OpenBlockFile (postx, true ), SER_DISK, CLIENT_VERSION);
14911491 if (file.IsNull ())
14921492 return error (" %s: OpenBlockFile failed" , __func__);
14931493 CBlockHeader header;
@@ -1546,7 +1546,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P
15461546bool WriteBlockToDisk (const CBlock& block, CDiskBlockPos& pos, const CMessageHeader::MessageStartChars& messageStart)
15471547{
15481548 // Open history file to append
1549- CAutoFile fileout (OpenBlockFile (pos), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
1549+ CAutoFile fileout (OpenBlockFile (pos), SER_DISK, CLIENT_VERSION);
15501550 if (fileout.IsNull ())
15511551 return error (" WriteBlockToDisk: OpenBlockFile failed" );
15521552
@@ -1569,7 +1569,7 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus:
15691569 block.SetNull ();
15701570
15711571 // Open history file to read
1572- CAutoFile filein (OpenBlockFile (pos, true ), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
1572+ CAutoFile filein (OpenBlockFile (pos, true ), SER_DISK, CLIENT_VERSION);
15731573 if (filein.IsNull ())
15741574 return error (" ReadBlockFromDisk: OpenBlockFile failed for %s" , pos.ToString ());
15751575
@@ -1959,7 +1959,7 @@ bool UndoWriteToDisk(const CBlockUndo& blockundo, CDiskBlockPos& pos, const uint
19591959 fileout << blockundo;
19601960
19611961 // calculate & write checksum
1962- CHashWriter hasher (SER_GETHASH, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS );
1962+ CHashWriter hasher (SER_GETHASH, PROTOCOL_VERSION);
19631963 hasher << hashBlock;
19641964 hasher << blockundo;
19651965 fileout << hasher.GetHash ();
@@ -1985,7 +1985,7 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CDiskBlockPos& pos, const uin
19851985 }
19861986
19871987 // Verify checksum
1988- CHashWriter hasher (SER_GETHASH, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS );
1988+ CHashWriter hasher (SER_GETHASH, PROTOCOL_VERSION);
19891989 hasher << hashBlock;
19901990 hasher << blockundo;
19911991 if (hashChecksum != hasher.GetHash ())
@@ -2431,7 +2431,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
24312431 UpdateCoins (tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo .back (), pindex->nHeight );
24322432
24332433 vPos.push_back (std::make_pair (tx.GetHash (), pos));
2434- pos.nTxOffset += ::GetSerializeSize (tx, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
2434+ pos.nTxOffset += ::GetSerializeSize (tx, SER_DISK, CLIENT_VERSION);
24352435 }
24362436 int64_t nTime3 = GetTimeMicros (); nTimeConnect += nTime3 - nTime2;
24372437 LogPrint (" bench" , " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n " , (unsigned )block.vtx .size (), 0.001 * (nTime3 - nTime2), 0.001 * (nTime3 - nTime2) / block.vtx .size (), nInputs <= 1 ? 0 : 0.001 * (nTime3 - nTime2) / (nInputs-1 ), nTimeConnect * 0.000001 );
@@ -3608,7 +3608,7 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha
36083608
36093609 // Write block to history file
36103610 try {
3611- unsigned int nBlockSize = ::GetSerializeSize (block, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
3611+ unsigned int nBlockSize = ::GetSerializeSize (block, SER_DISK, CLIENT_VERSION);
36123612 CDiskBlockPos blockPos;
36133613 if (dbp != NULL )
36143614 blockPos = *dbp;
@@ -4215,7 +4215,7 @@ bool InitBlockIndex(const CChainParams& chainparams)
42154215 try {
42164216 CBlock &block = const_cast <CBlock&>(chainparams.GenesisBlock ());
42174217 // Start new block file
4218- unsigned int nBlockSize = ::GetSerializeSize (block, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
4218+ unsigned int nBlockSize = ::GetSerializeSize (block, SER_DISK, CLIENT_VERSION);
42194219 CDiskBlockPos blockPos;
42204220 CValidationState state;
42214221 if (!FindBlockPos (state, blockPos, nBlockSize+8 , 0 , block.GetBlockTime ()))
@@ -4246,7 +4246,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB
42464246 int nLoaded = 0 ;
42474247 try {
42484248 // This takes over fileIn and calls fclose() on it in the CBufferedFile destructor
4249- CBufferedFile blkdat (fileIn, 2 *MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE+8 , SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS );
4249+ CBufferedFile blkdat (fileIn, 2 *MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE+8 , SER_DISK, CLIENT_VERSION);
42504250 uint64_t nRewind = blkdat.GetPos ();
42514251 while (!blkdat.eof ()) {
42524252 boost::this_thread::interruption_point ();
@@ -4671,7 +4671,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
46714671 if (inv.type == MSG_BLOCK)
46724672 pfrom->PushMessageWithFlag (SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::BLOCK, block);
46734673 else if (inv.type == MSG_WITNESS_BLOCK)
4674- pfrom->PushMessageWithFlag (SERIALIZE_TRANSACTION_WITNESS, NetMsgType::BLOCK, block);
4674+ pfrom->PushMessage ( NetMsgType::BLOCK, block);
46754675 else // MSG_FILTERED_BLOCK)
46764676 {
46774677 LOCK (pfrom->cs_filter );
@@ -4714,14 +4714,14 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
47144714 LOCK (cs_mapRelay);
47154715 map<uint256, CTransaction>::iterator mi = mapRelay.find (inv.hash );
47164716 if (mi != mapRelay.end ()) {
4717- pfrom->PushMessageWithFlag (inv.type == MSG_WITNESS_TX ? SERIALIZE_TRANSACTION_WITNESS : SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, (*mi).second );
4717+ pfrom->PushMessageWithFlag (inv.type == MSG_WITNESS_TX ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, (*mi).second );
47184718 pushed = true ;
47194719 }
47204720 }
47214721 if (!pushed && (inv.type == MSG_TX || inv.type == MSG_WITNESS_TX)) {
47224722 CTransaction tx;
47234723 if (mempool.lookup (inv.hash , tx)) {
4724- pfrom->PushMessageWithFlag (inv.type == MSG_WITNESS_TX ? SERIALIZE_TRANSACTION_WITNESS : SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, tx);
4724+ pfrom->PushMessageWithFlag (inv.type == MSG_WITNESS_TX ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, tx);
47254725 pushed = true ;
47264726 }
47274727 }
@@ -5226,7 +5226,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
52265226 vector<uint256> vWorkQueue;
52275227 vector<uint256> vEraseQueue;
52285228 CTransaction tx;
5229- WithOrVersion (& vRecv, SERIALIZE_TRANSACTION_WITNESS) >> tx;
5229+ vRecv >> tx;
52305230
52315231 CInv inv (MSG_TX, tx.GetHash ());
52325232 pfrom->AddInventoryKnown (inv);
@@ -5463,7 +5463,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
54635463 else if (strCommand == NetMsgType::BLOCK && !fImporting && !fReindex ) // Ignore blocks received while importing
54645464 {
54655465 CBlock block;
5466- WithOrVersion (& vRecv, SERIALIZE_TRANSACTION_WITNESS) >> block;
5466+ vRecv >> block;
54675467
54685468 CInv inv (MSG_BLOCK, block.GetHash ());
54695469 LogPrint (" net" , " received block %s peer=%d\n " , inv.hash .ToString (), pfrom->id );
0 commit comments