Browse Source

drop the optimistic write counter hack

This is now handled properly in realtime.
0.14
Cory Fields 8 years ago committed by Pieter Wuille
parent
commit
5c2169cc3f
  1. 5
      src/net.cpp
  2. 1
      src/net.h

5
src/net.cpp

@ -1167,10 +1167,6 @@ void CConnman::ThreadSocketHandler()
{ {
TRY_LOCK(pnode->cs_vSend, lockSend); TRY_LOCK(pnode->cs_vSend, lockSend);
if (lockSend) { if (lockSend) {
if (pnode->nOptimisticBytesWritten) {
RecordBytesSent(pnode->nOptimisticBytesWritten);
pnode->nOptimisticBytesWritten = 0;
}
if (!pnode->vSendMsg.empty()) { if (!pnode->vSendMsg.empty()) {
FD_SET(pnode->hSocket, &fdsetSend); FD_SET(pnode->hSocket, &fdsetSend);
continue; continue;
@ -2582,7 +2578,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
minFeeFilter = 0; minFeeFilter = 0;
lastSentFeeFilter = 0; lastSentFeeFilter = 0;
nextSendTimeFeeFilter = 0; nextSendTimeFeeFilter = 0;
nOptimisticBytesWritten = 0;
BOOST_FOREACH(const std::string &msg, getAllNetMessageTypes()) BOOST_FOREACH(const std::string &msg, getAllNetMessageTypes())
mapRecvBytesPerMsgCmd[msg] = 0; mapRecvBytesPerMsgCmd[msg] = 0;

1
src/net.h

@ -596,7 +596,6 @@ public:
CDataStream ssSend; CDataStream ssSend;
size_t nSendSize; // total size of all vSendMsg entries size_t nSendSize; // total size of all vSendMsg entries
size_t nSendOffset; // offset inside the first vSendMsg already sent size_t nSendOffset; // offset inside the first vSendMsg already sent
uint64_t nOptimisticBytesWritten;
uint64_t nSendBytes; uint64_t nSendBytes;
std::deque<CSerializeData> vSendMsg; std::deque<CSerializeData> vSendMsg;
CCriticalSection cs_vSend; CCriticalSection cs_vSend;

Loading…
Cancel
Save