aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-10-12 22:57:37 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-12-04 11:19:15 +0100
commitfa0f4157098ea68169ced44730986d0ed2c3a5aa (patch)
tree91a520e33681c8809c360c9f44429d88dd7670dd /src/net.h
parentdca80ffb45fcc8e6eedb6dc481d500dedab4248b (diff)
downloadbitcoin-fa0f4157098ea68169ced44730986d0ed2c3a5aa.tar.xz
net: Assume that SetCommonVersion is called at most once per peer
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 21ee5e7808..77aaaac5b1 100644
--- a/src/net.h
+++ b/src/net.h
@@ -24,14 +24,15 @@
#include <sync.h>
#include <threadinterrupt.h>
#include <uint256.h>
+#include <util/check.h>
#include <atomic>
+#include <condition_variable>
#include <cstdint>
#include <deque>
#include <map>
-#include <thread>
#include <memory>
-#include <condition_variable>
+#include <thread>
class CScheduler;
class CNode;
@@ -1131,6 +1132,7 @@ public:
void SetCommonVersion(int greatest_common_version)
{
+ Assume(m_greatest_common_version == INIT_PROTO_VERSION);
m_greatest_common_version = greatest_common_version;
}
int GetCommonVersion() const