aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c82b6fd5e..a49d2a06b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -180,8 +180,8 @@ bool AddOrphanTx(const CDataStream& vMsg)
// at most 500 megabytes of orphans:
if (pvMsg->size() > 5000)
{
- delete pvMsg;
printf("ignoring large orphan tx (size: %u, hash: %s)\n", pvMsg->size(), hash.ToString().substr(0,10).c_str());
+ delete pvMsg;
return false;
}
@@ -652,7 +652,15 @@ bool CTxMemPool::remove(CTransaction &tx)
return true;
}
+void CTxMemPool::queryHashes(std::vector<uint256>& vtxid)
+{
+ vtxid.clear();
+ LOCK(cs);
+ vtxid.reserve(mapTx.size());
+ for (map<uint256, CTransaction>::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi)
+ vtxid.push_back((*mi).first);
+}
@@ -1875,7 +1883,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str());
uiInterface.ThreadSafeMessageBox(strMessage, "Bitcoin", CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL);
- uiInterface.QueueShutdown();
+ StartShutdown();
return false;
}
return true;
@@ -2475,7 +2483,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
static uint256 hashSalt;
if (hashSalt == 0)
hashSalt = GetRandHash();
- int64 hashAddr = addr.GetHash();
+ uint64 hashAddr = addr.GetHash();
uint256 hashRand = hashSalt ^ (hashAddr<<32) ^ ((GetTime()+hashAddr)/(24*60*60));
hashRand = Hash(BEGIN(hashRand), END(hashRand));
multimap<uint256, CNode*> mapMix;
@@ -3013,8 +3021,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
// right now.
if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
+ uint64 nonce = 0;
if (pto->nVersion > BIP0031_VERSION)
- pto->PushMessage("ping", 0);
+ pto->PushMessage("ping", nonce);
else
pto->PushMessage("ping");
}