aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorSuhas Daftuar <[email protected]>2019-04-17 12:46:45 -0400
committerSuhas Daftuar <[email protected]>2019-04-17 12:46:45 -0400
commit8602d8b2138a06d5db7e5b86b839f400b0a905a4 (patch)
treeedfc8001b6fbb172c2409f4bbcf9435fc0129922 /src/net.h
parentMerge #15803: [0.18] Backport 15749: importmulti only imports origin info for... (diff)
downloaddiscoin-8602d8b2138a06d5db7e5b86b839f400b0a905a4.tar.xz
discoin-8602d8b2138a06d5db7e5b86b839f400b0a905a4.zip
Revert "Change in transaction pull scheduling to prevent InvBlock-related attacks"
This reverts commit 1cff3d6cb017aea87d16cbda0768bbab256d16da.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index f1d09f593..db44ec633 100644
--- a/src/net.h
+++ b/src/net.h
@@ -67,6 +67,10 @@ static const bool DEFAULT_UPNP = USE_UPNP;
#else
static const bool DEFAULT_UPNP = false;
#endif
+/** The maximum number of entries in mapAskFor */
+static const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ;
+/** The maximum number of entries in setAskFor (larger due to getdata latency)*/
+static const size_t SETASKFOR_MAX_SZ = 2 * MAX_INV_SZ;
/** The maximum number of peer connections to maintain. */
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
/** The default for -maxuploadtarget. 0 = Unlimited */
@@ -521,6 +525,8 @@ extern bool fDiscover;
extern bool fListen;
extern bool fRelayTxes;
+extern limitedmap<uint256, int64_t> mapAlreadyAskedFor;
+
/** Subversion as sent to the P2P network in `version` messages */
extern std::string strSubVersion;
@@ -709,6 +715,8 @@ public:
// and in the order requested.
std::vector<uint256> vInventoryBlockToSend GUARDED_BY(cs_inventory);
CCriticalSection cs_inventory;
+ std::set<uint256> setAskFor;
+ std::multimap<int64_t, CInv> mapAskFor;
int64_t nNextInvSend{0};
// Used for headers announcements - unfiltered blocks to relay
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
@@ -857,6 +865,8 @@ public:
vBlockHashesToAnnounce.push_back(hash);
}
+ void AskFor(const CInv& inv);
+
void CloseSocketDisconnect();
void copyStats(CNodeStats &stats);