diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-04-14 14:54:34 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-04-14 14:55:01 +0200 |
| commit | 97d0b9889f151449656d6b575f4f864df0f91a80 (patch) | |
| tree | 735b8c36054b5c3cd70b1a567849a1c73c92e397 /src/net.cpp | |
| parent | Merge #7849: tests: add varints_bitpatterns test (diff) | |
| parent | Use txid as key in mapAlreadyAskedFor (diff) | |
| download | discoin-97d0b9889f151449656d6b575f4f864df0f91a80.tar.xz discoin-97d0b9889f151449656d6b575f4f864df0f91a80.zip | |
Merge #7862: Use txid as key in mapAlreadyAskedFor
7e91f63 Use txid as key in mapAlreadyAskedFor (Suhas Daftuar)
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index e8cc753a4..3bf8c165d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -93,7 +93,7 @@ CCriticalSection cs_vNodes; map<CInv, CDataStream> mapRelay; deque<pair<int64_t, CInv> > vRelayExpiration; CCriticalSection cs_mapRelay; -limitedmap<CInv, int64_t> mapAlreadyAskedFor(MAX_INV_SZ); +limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ); static deque<string> vOneShots; CCriticalSection cs_vOneShots; @@ -2436,7 +2436,7 @@ void CNode::AskFor(const CInv& inv) // We're using mapAskFor as a priority queue, // the key is the earliest time the request can be sent int64_t nRequestTime; - limitedmap<CInv, int64_t>::const_iterator it = mapAlreadyAskedFor.find(inv); + limitedmap<uint256, int64_t>::const_iterator it = mapAlreadyAskedFor.find(inv.hash); if (it != mapAlreadyAskedFor.end()) nRequestTime = it->second; else @@ -2455,7 +2455,7 @@ void CNode::AskFor(const CInv& inv) if (it != mapAlreadyAskedFor.end()) mapAlreadyAskedFor.update(it, nRequestTime); else - mapAlreadyAskedFor.insert(std::make_pair(inv, nRequestTime)); + mapAlreadyAskedFor.insert(std::make_pair(inv.hash, nRequestTime)); mapAskFor.insert(std::make_pair(nRequestTime, inv)); } |