more careful initialization

This commit is contained in:
Brannon King 2020-01-28 12:33:10 -07:00
parent e5c233691f
commit d2b1aa52d5
3 changed files with 10 additions and 8 deletions

View file

@ -166,10 +166,10 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1548288000; // Jan 24, 2019 consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1548288000; // Jan 24, 2019
// The best chain should have at least this much work. // The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("00000000000000000000000000000000000000000000024108e3204a44a57a5a"); //621000 consensus.nMinimumChainWork = uint256S("0000000000000000000000000000000000000000000002bfdb5232f364d6774e"); //700k
// By default assume that the signatures in ancestors of this block are valid. // By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("7899464514d0d8854919e87eb234fd5f0c35d06418bd5fd3c1a8f7092b2a9317"); //620000 consensus.defaultAssumeValid = uint256S("beaf6432c9a7be3ea8c333bd7a90d4b3e07b0f20c86aa2e5dfebc9eba340201c"); //700k
/** /**
* The message start string is designed to be unlikely to occur in normal data. * The message start string is designed to be unlikely to occur in normal data.

View file

@ -1262,7 +1262,8 @@ void CConnman::ThreadSocketHandler()
for (const ListenSocket& hListenSocket : vhListenSocket) { for (const ListenSocket& hListenSocket : vhListenSocket) {
#ifdef USE_POLL #ifdef USE_POLL
pollfds[hListenSocket.socket].fd = hListenSocket.socket; pollfds[hListenSocket.socket].fd = hListenSocket.socket;
pollfds[hListenSocket.socket].events |= POLLIN; pollfds[hListenSocket.socket].events = POLLIN;
pollfds[hListenSocket.socket].revents = 0;
#else #else
FD_SET(hListenSocket.socket, &fdsetRecv); FD_SET(hListenSocket.socket, &fdsetRecv);
hSocketMax = std::max(hSocketMax, hListenSocket.socket); hSocketMax = std::max(hSocketMax, hListenSocket.socket);
@ -1298,7 +1299,8 @@ void CConnman::ThreadSocketHandler()
#ifdef USE_POLL #ifdef USE_POLL
pollfds[pnode->hSocket].fd = pnode->hSocket; pollfds[pnode->hSocket].fd = pnode->hSocket;
pollfds[pnode->hSocket].events |= POLLERR|POLLHUP; pollfds[pnode->hSocket].events = POLLERR|POLLHUP;
pollfds[pnode->hSocket].revents = 0;
#else #else
FD_SET(pnode->hSocket, &fdsetError); FD_SET(pnode->hSocket, &fdsetError);
hSocketMax = std::max(hSocketMax, pnode->hSocket); hSocketMax = std::max(hSocketMax, pnode->hSocket);
@ -1307,7 +1309,6 @@ void CConnman::ThreadSocketHandler()
if (select_send) { if (select_send) {
#ifdef USE_POLL #ifdef USE_POLL
pollfds[pnode->hSocket].fd = pnode->hSocket;
pollfds[pnode->hSocket].events |= POLLOUT; pollfds[pnode->hSocket].events |= POLLOUT;
#else #else
FD_SET(pnode->hSocket, &fdsetSend); FD_SET(pnode->hSocket, &fdsetSend);
@ -1316,7 +1317,6 @@ void CConnman::ThreadSocketHandler()
} }
if (select_recv) { if (select_recv) {
#ifdef USE_POLL #ifdef USE_POLL
pollfds[pnode->hSocket].fd = pnode->hSocket;
pollfds[pnode->hSocket].events |= POLLIN; pollfds[pnode->hSocket].events |= POLLIN;
#else #else
FD_SET(pnode->hSocket, &fdsetRecv); FD_SET(pnode->hSocket, &fdsetRecv);

View file

@ -272,9 +272,10 @@ static IntrRecvError InterruptibleRecv(uint8_t* data, size_t len, int timeout, c
// we're approaching the end of the specified total timeout // we're approaching the end of the specified total timeout
int timeout_ms = std::min(endTime - curTime, maxWait); int timeout_ms = std::min(endTime - curTime, maxWait);
#ifdef USE_POLL #ifdef USE_POLL
struct pollfd pollfd = {}; struct pollfd pollfd;
pollfd.fd = hSocket; pollfd.fd = hSocket;
pollfd.events = POLLIN; pollfd.events = POLLIN;
pollfd.revents = 0;
int nRet = poll(&pollfd, 1, timeout_ms); int nRet = poll(&pollfd, 1, timeout_ms);
#else #else
struct timeval tval = MillisToTimeval(timeout_ms); struct timeval tval = MillisToTimeval(timeout_ms);
@ -514,9 +515,10 @@ bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET& hSocket, i
if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)
{ {
#ifdef USE_POLL #ifdef USE_POLL
struct pollfd pollfd = {}; struct pollfd pollfd;
pollfd.fd = hSocket; pollfd.fd = hSocket;
pollfd.events = POLLIN | POLLOUT; pollfd.events = POLLIN | POLLOUT;
pollfd.revents = 0;
int nRet = poll(&pollfd, 1, nTimeout); int nRet = poll(&pollfd, 1, nTimeout);
#else #else
struct timeval timeout = MillisToTimeval(nTimeout); struct timeval timeout = MillisToTimeval(nTimeout);