Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions builds/cmake/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ main()
secp256k1_OPTIONS=(
"-DSECP256K1_BUILD_TESTS=OFF"
"-DSECP256K1_EXPERIMENTAL=ON"
"-DSECP256K1_ENABLE_MODULE_ELLSWIFT=ON"
"-DSECP256K1_ENABLE_MODULE_RECOVERY=ON"
"-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON")

Expand Down
1 change: 1 addition & 0 deletions builds/cmake/install-presets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ main()
secp256k1_OPTIONS=(
"-DSECP256K1_BUILD_TESTS=OFF"
"-DSECP256K1_EXPERIMENTAL=ON"
"-DSECP256K1_ENABLE_MODULE_ELLSWIFT=ON"
"-DSECP256K1_ENABLE_MODULE_RECOVERY=ON"
"-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON")

Expand Down
1 change: 1 addition & 0 deletions builds/gnu/install-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ main()
secp256k1_OPTIONS=(
"--disable-tests"
"--enable-experimental"
"--enable-module-ellswift"
"--enable-module-recovery"
"--enable-module-schnorrsig")

Expand Down
2 changes: 2 additions & 0 deletions include/bitcoin/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
#include <bitcoin/server/parsers/admin_target.hpp>
#include <bitcoin/server/parsers/bitcoind_script.hpp>
#include <bitcoin/server/parsers/bitcoind_target.hpp>
#include <bitcoin/server/parsers/block_stats.hpp>
#include <bitcoin/server/parsers/btcd_filter.hpp>
#include <bitcoin/server/parsers/descriptor.hpp>
#include <bitcoin/server/parsers/electrum_version.hpp>
#include <bitcoin/server/parsers/native_query.hpp>
#include <bitcoin/server/parsers/native_target.hpp>
Expand Down
49 changes: 35 additions & 14 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ parser::parser(system::chain::selection context,
configured.network.protocol_minimum = level::headers_protocol;
configured.network.protocol_maximum = level::bip130;

// services_minimum must be node_witness to be a witness node.
configured.network.services_minimum = service::node_network | service::node_witness;
configured.network.services_maximum = service::node_network | service::node_witness;

// TODO: from bitcoind, revert to defaults when seeds are up.
configured.network.outbound.seeds.clear();
configured.network.outbound.seeds.emplace_back("seed.bitcoin.sipa.be", 8333_u16);
Expand Down Expand Up @@ -583,16 +579,6 @@ options_metadata parser::load_settings() THROWS
value<uint32_t>(&configured.network.protocol_minimum),
"The minimum network protocol version, defaults to '31800'."
)
(
"peer.services_maximum",
value<uint64_t>(&configured.network.services_maximum),
"The maximum services exposed by network connections, defaults to '9' (full node, witness)."
)
(
"peer.services_minimum",
value<uint64_t>(&configured.network.services_minimum),
"The minimum services exposed by network connections, defaults to '9' (full node, witness)."
)
(
"peer.invalid_services",
value<uint64_t>(&configured.network.invalid_services),
Expand Down Expand Up @@ -633,6 +619,11 @@ options_metadata parser::load_settings() THROWS
value<bool>(&configured.network.enable_relay),
"Enable transaction relay, defaults to 'true'."
)
(
"peer.enable_privacy",
value<bool>(&configured.network.enable_privacy),
"Enable opportunistic connection encryption, defaults to 'false'."
)
(
"peer.validate_checksum",
value<bool>(&configured.network.validate_checksum),
Expand Down Expand Up @@ -1487,6 +1478,36 @@ options_metadata parser::load_settings() THROWS
value<bool>(&configured.node.delay_inbound),
"Delay accepting inbound connections until node is current, defaults to 'true'."
)
(
"node.provide_blocks",
value<bool>(&configured.node.provide_blocks),
"Serve blocks to network connections, defaults to 'true'."
)
(
"node.limited_blocks",
value<bool>(&configured.node.limited_blocks),
"Limit block service to recent blocks, defaults to 'false'."
)
(
"node.require_blocks",
value<bool>(&configured.node.require_blocks),
"Require block service of outbound connections, defaults to 'true'."
)
(
"node.provide_witness",
value<bool>(&configured.node.provide_witness),
"Serve witness data to network connections, defaults to 'true'."
)
(
"node.require_witness",
value<bool>(&configured.node.require_witness),
"Require witness service of outbound connections, defaults to 'true'."
)
(
"node.provide_filters",
value<bool>(&configured.node.provide_filters),
"Serve client filters to network connections, defaults to 'false'."
)
(
"node.batch_signatures",
value<uint64_t>(&configured.node.batch_signatures),
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool protocol_bitcoind_blockchain::handle_get_block_chain_info(const code& ec,
return false;

object_t out{};
if (!chain_info(out, archive(), network_settings().pruned_node(),
if (!chain_info(out, archive(), node_settings().limited_blocks,
is_current_chain(true)))
{
send_error(database::error::integrity);
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/bitcoind/protocol_bitcoind_rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ bool protocol_bitcoind_rest::handle_get_chain_information(const code& ec,
{ "difficulty", header->difficulty() },
{ "time", header->timestamp() },
{ "mediantime", median_time_past(query, link) },
{ "pruned", network_settings().pruned_node() }
{ "pruned", node_settings().limited_blocks }
}, 256);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/btcd/protocol_btcd_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool protocol_btcd::handle_get_block_chain_info(const code& ec,
return false;

object_t out{};
if (!chain_info(out, archive(), network_settings().pruned_node(),
if (!chain_info(out, archive(), node_settings().limited_blocks,
is_current_chain(true)))
{
send_error(database::error::integrity);
Expand Down
12 changes: 9 additions & 3 deletions src/protocols/electrum/protocol_electrum_subscribe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ void protocol_electrum::do_scripthash_subscribe(const hash_digest& hash,

// Initial subscription is limited by configured maximum history.
const auto limit = at.second ? options().maximum_history : max_size_t;
ec = get_scripthash_history(at.first->second, at.first->first, limit);
status = at.first->second.status;
subscribed_address_.store(true, relaxed);
if ((ec = get_scripthash_history(at.first->second, at.first->first, limit)))
{
if (at.second) address_subscriptions_.erase(at.first);
}
else
{
status = at.first->second.status;
subscribed_address_.store(true, relaxed);
}
}

POST(complete_scripthash_subscribe, ec, std::move(status));
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/native/protocol_native_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool protocol_native::handle_get_configuration(const code& ec,
{ "address", archive().address_enabled() },
{ "filter", archive().filter_enabled() },
{ "turbo", database_settings().turbo },
{ "witness", network_settings().witness_node() },
{ "witness", node_settings().require_witness },
{ "retarget", system_settings().forks.retarget },
{ "difficult", system_settings().forks.difficult },
{ "pruned", get_pruned_height() },
Expand All @@ -61,7 +61,7 @@ bool protocol_native::handle_get_configuration(const code& ec,

size_t protocol_native::get_pruned_height() NOEXCEPT
{
if (!network_settings().pruned_node())
if (!node_settings().limited_blocks)
return {};

const auto& system_ = system_settings();
Expand Down
Loading