mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-25 22:39:13 +02:00
kernel: allow null data_directory
An empty path may be represented with a nullptr. For example, std::string_view::data() may return nullptr. Removes the BITCOINKERNEL_ARG_NONNULL attribute for data_directory, and instead handles such null arguments in the implementation. Also documents how BITCOINKERNEL_ARG_NONNULL should be used.
This commit is contained in:
@@ -937,8 +937,9 @@ public:
|
||||
class ChainstateManagerOptions : public UniqueHandle<btck_ChainstateManagerOptions, btck_chainstate_manager_options_destroy>
|
||||
{
|
||||
public:
|
||||
ChainstateManagerOptions(const Context& context, const std::string& data_dir, const std::string& blocks_dir)
|
||||
: UniqueHandle{btck_chainstate_manager_options_create(context.get(), data_dir.c_str(), data_dir.length(), blocks_dir.c_str(), blocks_dir.length())}
|
||||
ChainstateManagerOptions(const Context& context, std::string_view data_dir, std::string_view blocks_dir)
|
||||
: UniqueHandle{btck_chainstate_manager_options_create(
|
||||
context.get(), data_dir.data(), data_dir.length(), blocks_dir.data(), blocks_dir.length())}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user