aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2021-03-17 10:52:16 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2021-03-17 12:17:33 +0100
commita9d1b40d53ec417eefbe767aa66701ef8e1801d5 (patch)
treee7a827d8f9143a83227ccb90085214b4449bbfd5 /src/net.h
parent993ecafa5eb7f87574e2befc0e2057d4662a7f56 (diff)
parentebc4ab721b0371c0ef217c0f5bd7d42613e951e6 (diff)
downloadbitcoin-a9d1b40d53ec417eefbe767aa66701ef8e1801d5.tar.xz
Merge #21415: refactor: remove Optional & nullopt
ebc4ab721b0371c0ef217c0f5bd7d42613e951e6 refactor: post Optional<> removal cleanups (fanquake) 57e980d13ca488031bde6ef197cf34d493d36796 scripted-diff: remove Optional & nullopt (fanquake) Pull request description: Same rationale & motivation as #21404, which turned out to be quite low in the number of potential conflicts. Lets see what the bot has to say here. ACKs for top commit: practicalswift: cr ACK ebc4ab721b0371c0ef217c0f5bd7d42613e951e6: patch looks correct jnewbery: utACK ebc4ab721b0371c0ef217c0f5bd7d42613e951e6 laanwj: Code review ACK ebc4ab721b0371c0ef217c0f5bd7d42613e951e6 Tree-SHA512: 550fbeef09b9d35ddefaa805d1755c18c8fd499c4b0f77ebfece8c20296a7abd1cf6c699e2261f92fe3552deeb7555ec2a2287ffe3ab9e98bb9f8612a4d43be3
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net.h b/src/net.h
index beef47f045..48d37084a0 100644
--- a/src/net.h
+++ b/src/net.h
@@ -18,7 +18,6 @@
#include <net_permissions.h>
#include <netaddress.h>
#include <netbase.h>
-#include <optional.h>
#include <policy/feerate.h>
#include <protocol.h>
#include <random.h>
@@ -35,6 +34,7 @@
#include <deque>
#include <map>
#include <memory>
+#include <optional>
#include <thread>
#include <vector>
@@ -200,7 +200,7 @@ enum
bool IsPeerAddrLocalGood(CNode *pnode);
/** Returns a local address that we should advertise to this peer */
-Optional<CAddress> GetLocalAddrForPeer(CNode *pnode);
+std::optional<CAddress> GetLocalAddrForPeer(CNode *pnode);
/**
* Mark a network as reachable or unreachable (no automatic connects to it)
@@ -311,7 +311,7 @@ public:
/** read and deserialize data, advances msg_bytes data pointer */
virtual int Read(Span<const uint8_t>& msg_bytes) = 0;
// decomposes a message from the context
- virtual Optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err) = 0;
+ virtual std::optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err) = 0;
virtual ~TransportDeserializer() {}
};
@@ -375,7 +375,7 @@ public:
}
return ret;
}
- Optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err_raw_size) override;
+ std::optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err_raw_size) override;
};
/** The TransportSerializer prepares messages for the network transport
@@ -1283,6 +1283,6 @@ struct NodeEvictionCandidate
bool m_is_local;
};
-[[nodiscard]] Optional<NodeId> SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates);
+[[nodiscard]] std::optional<NodeId> SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates);
#endif // BITCOIN_NET_H