mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 06:39:15 +02:00
streams: Remove confusing DataStream::in_avail()
The alias of the size() method is confusing, because: * It claims to be part of the Bitcoin Core stream subset (streams interface), but this is not used by any other stream interface. Mostly the `write(std::span)` and `read(std::span)` define the stream interface. * It casts the size_t to i32, but the only place that calls the function casts that back to size_t. * Providing this alias for size() without a proper reason is confusing. Fix all issues by removing it and using the size() method.
This commit is contained in:
@@ -5557,7 +5557,7 @@ bool PeerManagerImpl::RejectIncomingTxs(const CNode& peer) const
|
||||
void PeerManagerImpl::ProcessPong(CNode& pfrom, Peer& peer, const NodeClock::time_point ping_end, DataStream& vRecv)
|
||||
{
|
||||
uint64_t nonce = 0;
|
||||
size_t nAvail = vRecv.in_avail();
|
||||
const size_t nAvail{vRecv.size()};
|
||||
bool bPingFinished = false;
|
||||
std::string sProblem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user