mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
scripted-diff: remove Optional & nullopt
-BEGIN VERIFY SCRIPT-
git rm src/optional.h
sed -i -e 's/Optional</std::optional</g' $(git grep -l 'Optional<' src)
sed -i -e 's/{nullopt}/{std::nullopt}/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt;/ std::nullopt;/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt)/ std::nullopt)/g' $(git grep -l 'nullopt' src)
sed -i -e 's/(nullopt)/(std::nullopt)/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt,/ std::nullopt,/g' $(git grep -l 'nullopt' src)
sed -i -e 's/? nullopt :/? std::nullopt :/g' $(git grep -l 'nullopt' src)
sed -i -e 's/: nullopt}/: std::nullopt}/g' $(git grep -l 'nullopt' src)
sed -i -e '/optional.h \\/d' src/Makefile.am
sed -i -e '/#include <optional.h>/d' src/test/fuzz/autofile.cpp src/test/fuzz/buffered_file.cpp src/test/fuzz/node_eviction.cpp
sed -i -e 's/#include <optional.h>/#include <optional>/g' $(git grep -l '#include <optional.h>' src)
-END VERIFY SCRIPT-
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#ifndef BITCOIN_INTERFACES_CHAIN_H
|
||||
#define BITCOIN_INTERFACES_CHAIN_H
|
||||
|
||||
#include <optional.h> // For Optional and nullopt
|
||||
#include <optional> // For Optional and nullopt
|
||||
#include <primitives/transaction.h> // For CTransactionRef
|
||||
#include <util/settings.h> // For util::SettingsValue
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
//! Get current chain height, not including genesis block (returns 0 if
|
||||
//! chain only contains genesis block, nullopt if chain does not contain
|
||||
//! any blocks)
|
||||
virtual Optional<int> getHeight() = 0;
|
||||
virtual std::optional<int> getHeight() = 0;
|
||||
|
||||
//! Get block hash. Height must be valid or this function will abort.
|
||||
virtual uint256 getBlockHash(int height) = 0;
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
//! Return height of the highest block on chain in common with the locator,
|
||||
//! which will either be the original block used to create the locator,
|
||||
//! or one of its ancestors.
|
||||
virtual Optional<int> findLocatorFork(const CBlockLocator& locator) = 0;
|
||||
virtual std::optional<int> findLocatorFork(const CBlockLocator& locator) = 0;
|
||||
|
||||
//! Check if transaction will be final given chain height current time.
|
||||
virtual bool checkFinalTx(const CTransaction& tx) = 0;
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
//! Return true if data is available for all blocks in the specified range
|
||||
//! of blocks. This checks all blocks that are ancestors of block_hash in
|
||||
//! the height range from min_height to max_height, inclusive.
|
||||
virtual bool hasBlocks(const uint256& block_hash, int min_height = 0, Optional<int> max_height = {}) = 0;
|
||||
virtual bool hasBlocks(const uint256& block_hash, int min_height = 0, std::optional<int> max_height = {}) = 0;
|
||||
|
||||
//! Check if transaction is RBF opt in.
|
||||
virtual RBFTransactionState isRBFOptIn(const CTransaction& tx) = 0;
|
||||
|
||||
Reference in New Issue
Block a user