Skip to content

Commit 06a6f84

Browse files
committed
merge bitcoin#25147: follow ups to bitcoin#20799 (removing support for v1 compact blocks)
1 parent 6274a57 commit 06a6f84

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ static uint256 most_recent_block_hash GUARDED_BY(cs_most_recent_block);
19911991
* to compatible peers.
19921992
*/
19931993
void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) {
1994-
std::shared_ptr<const CBlockHeaderAndShortTxIDs> pcmpctblock = std::make_shared<const CBlockHeaderAndShortTxIDs> (*pblock);
1994+
auto pcmpctblock = std::make_shared<const CBlockHeaderAndShortTxIDs>(*pblock);
19951995
const CNetMsgMaker msgMaker(PROTOCOL_VERSION);
19961996

19971997
LOCK(cs_main);
@@ -2468,7 +2468,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
24682468
a_recent_compact_block->header.GetHash() == pindex->GetBlockHash()) {
24692469
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::CMPCTBLOCK, *a_recent_compact_block));
24702470
} else {
2471-
CBlockHeaderAndShortTxIDs cmpctblock(*pblock);
2471+
CBlockHeaderAndShortTxIDs cmpctblock{*pblock};
24722472
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::CMPCTBLOCK, cmpctblock));
24732473
}
24742474
} else {
@@ -5518,7 +5518,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
55185518
CBlock block;
55195519
bool ret = ReadBlockFromDisk(block, pBestIndex, consensusParams);
55205520
assert(ret);
5521-
CBlockHeaderAndShortTxIDs cmpctblock(block);
5521+
CBlockHeaderAndShortTxIDs cmpctblock{block};
55225522
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::CMPCTBLOCK, cmpctblock));
55235523
}
55245524
state.pindexBestHeaderSent = pBestIndex;

src/test/blockencodings_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
6464

6565
// Do a simple ShortTxIDs RT
6666
{
67-
CBlockHeaderAndShortTxIDs shortIDs(block);
67+
CBlockHeaderAndShortTxIDs shortIDs{block};
6868

6969
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
7070
stream << shortIDs;
@@ -122,7 +122,7 @@ class TestHeaderAndShortIDs {
122122
stream >> *this;
123123
}
124124
explicit TestHeaderAndShortIDs(const CBlock& block) :
125-
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block)) {}
125+
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs{block}) {}
126126

127127
uint64_t GetShortID(const uint256& txhash) const {
128128
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
@@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
279279

280280
// Test simple header round-trip with only coinbase
281281
{
282-
CBlockHeaderAndShortTxIDs shortIDs(block);
282+
CBlockHeaderAndShortTxIDs shortIDs{block};
283283

284284
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
285285
stream << shortIDs;

0 commit comments

Comments
 (0)