diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 5e0651aa3a3..b26abab8a62 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -4135,6 +4135,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, if (msg_type == NetMsgType::GETBLOCKTXN) { BlockTransactionsRequest req; vRecv >> req; + // Verify differential encoding invariant: indexes must be strictly increasing + // DifferenceFormatter should guarantee this property during deserialization + for (size_t i = 1; i < req.indexes.size(); ++i) { + Assume(req.indexes[i] > req.indexes[i-1]); + } std::shared_ptr recent_block; {