aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6902194016..b57974f577 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,9 +21,6 @@ set<CWallet*> setpwalletRegistered;
CCriticalSection cs_main;
-CCriticalSection cs_mapPubKeys;
-map<uint160, vector<unsigned char> > mapPubKeys;
-
map<uint256, CTransaction> mapTransactions;
CCriticalSection cs_mapTransactions;
unsigned int nTransactionsUpdated = 0;
@@ -1899,6 +1896,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
return error("message addr size() = %d", vAddr.size());
// Store the new addresses
+ CAddrDB addrDB;
+ addrDB.TxnBegin();
int64 nNow = GetAdjustedTime();
int64 nSince = nNow - 10 * 60;
BOOST_FOREACH(CAddress& addr, vAddr)
@@ -1910,7 +1909,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
continue;
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60;
- AddAddress(addr, 2 * 60 * 60);
+ AddAddress(addr, 2 * 60 * 60, &addrDB);
pfrom->AddAddressKnown(addr);
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
{
@@ -1941,6 +1940,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
}
}
+ addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
if (vAddr.size() < 1000)
pfrom->fGetAddr = false;
}
@@ -2567,6 +2567,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
vGetData.clear();
}
}
+ mapAlreadyAskedFor[inv] = nNow;
pto->mapAskFor.erase(pto->mapAskFor.begin());
}
if (!vGetData.empty())