Skip to content

Commit 183fd1b

Browse files
authoredMay 2, 2017
Merge pull request #313 from evoskuil/version3
version 3.2.0
2 parents 5349882 + 21e9a9a commit 183fd1b

17 files changed

+266
-135
lines changed
 

‎builds/msvc/resource.rc

0 Bytes
Binary file not shown.

‎configure.ac

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
AC_PREREQ([2.65])
1414

1515
# Process command-line arguments and perform initialization and verification.
16-
AC_INIT([libbitcoin-node], [3.1.0], [eric@voskuil.org])
16+
AC_INIT([libbitcoin-node], [3.2.0], [eric@voskuil.org])
1717

1818
# Do compilation tests.
1919
AC_LANG(C++)
@@ -157,18 +157,18 @@ AS_CASE([${bash_completiondir}], [yes],
157157
AC_MSG_NOTICE([bash_completion_LIBS : ${bash_completion_LIBS}])],
158158
[AC_SUBST([bash_completion_PKG], [])])
159159

160-
# Require bitcoin-blockchain of at least version 3.1.0 and output ${bitcoin_blockchain_CPPFLAGS/LIBS/PKG}.
160+
# Require bitcoin-blockchain of at least version 3.2.0 and output ${bitcoin_blockchain_CPPFLAGS/LIBS/PKG}.
161161
#------------------------------------------------------------------------------
162-
PKG_CHECK_MODULES([bitcoin_blockchain], [libbitcoin-blockchain >= 3.1.0])
163-
AC_SUBST([bitcoin_blockchain_PKG], ['libbitcoin-blockchain >= 3.1.0'])
162+
PKG_CHECK_MODULES([bitcoin_blockchain], [libbitcoin-blockchain >= 3.2.0])
163+
AC_SUBST([bitcoin_blockchain_PKG], ['libbitcoin-blockchain >= 3.2.0'])
164164
AC_SUBST([bitcoin_blockchain_CPPFLAGS], [${bitcoin_blockchain_CFLAGS}])
165165
AC_MSG_NOTICE([bitcoin_blockchain_CPPFLAGS : ${bitcoin_blockchain_CPPFLAGS}])
166166
AC_MSG_NOTICE([bitcoin_blockchain_LIBS : ${bitcoin_blockchain_LIBS}])
167167

168-
# Require bitcoin-network of at least version 3.1.0 and output ${bitcoin_network_CPPFLAGS/LIBS/PKG}.
168+
# Require bitcoin-network of at least version 3.2.0 and output ${bitcoin_network_CPPFLAGS/LIBS/PKG}.
169169
#------------------------------------------------------------------------------
170-
PKG_CHECK_MODULES([bitcoin_network], [libbitcoin-network >= 3.1.0])
171-
AC_SUBST([bitcoin_network_PKG], ['libbitcoin-network >= 3.1.0'])
170+
PKG_CHECK_MODULES([bitcoin_network], [libbitcoin-network >= 3.2.0])
171+
AC_SUBST([bitcoin_network_PKG], ['libbitcoin-network >= 3.2.0'])
172172
AC_SUBST([bitcoin_network_CPPFLAGS], [${bitcoin_network_CFLAGS}])
173173
AC_MSG_NOTICE([bitcoin_network_CPPFLAGS : ${bitcoin_network_CPPFLAGS}])
174174
AC_MSG_NOTICE([bitcoin_network_LIBS : ${bitcoin_network_LIBS}])

‎console/executor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ executor::executor(parser& metadata, std::istream& input,
5252
: metadata_(metadata), output_(output), error_(error)
5353
{
5454
const auto& network = metadata_.configured.network;
55+
const auto verbose = network.verbose;
5556

5657
const log::rotable_file debug_file
5758
{
@@ -76,7 +77,7 @@ executor::executor(parser& metadata, std::istream& input,
7677
log::stream console_out(&output_, null_deleter());
7778
log::stream console_err(&error_, null_deleter());
7879

79-
log::initialize(debug_file, error_file, console_out, console_err);
80+
log::initialize(debug_file, error_file, console_out, console_err, verbose);
8081
handle_stop(initialize_stop);
8182
}
8283

‎data/bn.cfg

+12-8
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ priority = true
103103
use_libconsensus = false
104104
# The maximum reorganization depth, defaults to 256 (0 for unlimited).
105105
reorganization_limit = 256
106-
# The block version for block creation and transaction pool validation, defaults to 4.
107-
block_version = 4
108106
# A hash:height checkpoint, multiple entries allowed, defaults shown.
109107
checkpoint = 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f:0
110108
checkpoint = 0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d:11111
@@ -150,11 +148,17 @@ bip65 = true
150148
bip90 = true
151149

152150
[node]
153-
# The time period for block polling after initial block download, defaults to 1 (0 disables).
154-
block_poll_seconds = 1
155-
# The minimum fee per byte required for transaction acceptance, defaults to 1.
156-
minimum_byte_fee_satoshis = 1
157-
# Request that peers relay transactions, defaults to false.
158-
relay_transactions = false
151+
# The time to wait for a requested block, defaults to 60.
152+
block_latency_seconds = 60
153+
# Disable relay when top block age exceeds, defaults to 24 (0 disables).
154+
notify_limit_hours = 24
155+
# The minimum fee per byte, cumulative for conflicts, defaults to 1.
156+
byte_fee_satoshis = 1
157+
# The minimum fee per sigop, additional to byte fee, defaults to 100.
158+
sigop_fee_satoshis = 100
159+
# The minimum output value, defaults to 500.
160+
minimum_output_satoshis = 500
161+
# Request that peers relay transactions, defaults to true.
162+
relay_transactions = true
159163
# Request transactions on each channel start, defaults to true.
160164
refresh_transactions = true

‎include/bitcoin/node/protocols/protocol_block_in.hpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#ifndef LIBBITCOIN_NODE_PROTOCOL_BLOCK_IN_HPP
2020
#define LIBBITCOIN_NODE_PROTOCOL_BLOCK_IN_HPP
2121

22-
#include <atomic>
2322
#include <cstddef>
2423
#include <cstdint>
2524
#include <memory>
25+
#include <queue>
2626
#include <bitcoin/blockchain.hpp>
2727
#include <bitcoin/network.hpp>
2828
#include <bitcoin/node/define.hpp>
@@ -46,9 +46,10 @@ class BCN_API protocol_block_in
4646
virtual void start();
4747

4848
private:
49+
typedef std::queue<hash_digest> hash_queue;
50+
4951
static void report(const chain::block& block);
5052

51-
void get_block_inventory(const code& ec);
5253
void send_get_blocks(const hash_digest& stop_hash);
5354
void send_get_data(const code& ec, get_data_ptr message);
5455

@@ -60,14 +61,19 @@ class BCN_API protocol_block_in
6061
void handle_fetch_block_locator(const code& ec, get_headers_ptr message,
6162
const hash_digest& stop_hash);
6263

64+
void handle_timeout(const code& ec);
6365
void handle_stop(const code& ec);
6466

67+
// These are thread safe.
6568
full_node& node_;
6669
blockchain::safe_chain& chain_;
67-
bc::atomic<hash_digest> last_locator_top_;
68-
const uint32_t block_poll_seconds_;
70+
const asio::duration block_latency_;
6971
const bool headers_from_peer_;
7072
const bool blocks_from_peer_;
73+
74+
// This is protected by mutex.
75+
hash_queue backlog_;
76+
mutable upgrade_mutex mutex;
7177
};
7278

7379
} // namespace node

‎include/bitcoin/node/protocols/protocol_block_out.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class BCN_API protocol_block_out
4949
size_t locator_limit();
5050

5151
void send_next_data(inventory_ptr inventory);
52-
void send_block(const code& ec, block_ptr message,
52+
void send_block(const code& ec, block_const_ptr message,
5353
uint64_t height, inventory_ptr inventory);
54-
void send_merkle_block(const code& ec, merkle_block_ptr message,
54+
void send_merkle_block(const code& ec, merkle_block_const_ptr message,
5555
uint64_t height, inventory_ptr inventory);
56-
void send_compact_block(const code& ec, compact_block_ptr message,
56+
void send_compact_block(const code& ec, compact_block_const_ptr message,
5757
uint64_t height, inventory_ptr inventory);
5858

5959
bool handle_receive_get_data(const code& ec,

‎include/bitcoin/node/protocols/protocol_transaction_out.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BCN_API protocol_transaction_out
4646

4747
private:
4848
void send_next_data(inventory_ptr inventory);
49-
void send_transaction(const code& ec, transaction_ptr transaction,
49+
void send_transaction(const code& ec, transaction_const_ptr transaction,
5050
size_t height, size_t position, inventory_ptr inventory);
5151

5252
bool handle_receive_get_data(const code& ec,
@@ -60,7 +60,8 @@ class BCN_API protocol_transaction_out
6060

6161
void handle_stop(const code& ec);
6262
void handle_send_next(const code& ec, inventory_ptr inventory);
63-
bool handle_notification(const code& ec, transaction_const_ptr message);
63+
bool handle_transaction_pool(const code& ec,
64+
transaction_const_ptr message);
6465

6566
blockchain::safe_chain& chain_;
6667
std::atomic<uint64_t> minimum_peer_fee_;

‎include/bitcoin/node/settings.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ class BCN_API settings
3636
/// Properties.
3737
uint32_t sync_peers;
3838
uint32_t sync_timeout_seconds;
39-
uint32_t block_poll_seconds;
39+
uint32_t block_latency_seconds;
4040
bool refresh_transactions;
41+
42+
/// Helpers.
43+
asio::duration block_latency() const;
4144
};
4245

4346
} // namespace node

‎include/bitcoin/node/version.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* For interpretation of the versioning scheme see: http://semver.org
1313
*/
1414

15-
#define LIBBITCOIN_NODE_VERSION "3.1.0"
15+
#define LIBBITCOIN_NODE_VERSION "3.2.0"
1616
#define LIBBITCOIN_NODE_MAJOR_VERSION 3
17-
#define LIBBITCOIN_NODE_MINOR_VERSION 1
17+
#define LIBBITCOIN_NODE_MINOR_VERSION 2
1818
#define LIBBITCOIN_NODE_PATCH_VERSION 0
1919

2020
#endif

‎libbitcoin-node.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@
2525
#==============================================================================
2626
# Dependencies that publish package configuration.
2727
#------------------------------------------------------------------------------
28-
Requires: libbitcoin-blockchain >= 3.1.0 libbitcoin-network >= 3.1.0
28+
Requires: libbitcoin-blockchain >= 3.2.0 libbitcoin-network >= 3.2.0
2929

3030
# Include directory and any other required compiler flags.
3131
#------------------------------------------------------------------------------

‎src/full_node.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ bool full_node::stop()
259259

260260
if (!chain_stop)
261261
LOG_ERROR(LOG_NODE)
262-
<< "Failed to stop database.";
262+
<< "Failed to stop blockchain.";
263263

264264
return p2p_stop && chain_stop;
265265
}
@@ -280,7 +280,7 @@ bool full_node::close()
280280

281281
if (!chain_close)
282282
LOG_ERROR(LOG_NODE)
283-
<< "Failed to close database.";
283+
<< "Failed to close blockchain.";
284284

285285
return p2p_close && chain_close;
286286
}

‎src/parser.cpp

+26-19
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,6 @@ options_metadata parser::load_settings()
346346
value<uint32_t>(&configured.chain.reorganization_limit),
347347
"The maximum reorganization depth, defaults to 256 (0 for unlimited)."
348348
)
349-
(
350-
"blockchain.block_version",
351-
value<uint32_t>(&configured.chain.block_version),
352-
"The block version for block creation and transaction pool validation, defaults to 4."
353-
)
354349
(
355350
"blockchain.checkpoint",
356351
value<config::checkpoint::list>(&configured.chain.checkpoints),
@@ -361,7 +356,7 @@ options_metadata parser::load_settings()
361356
(
362357
"fork.easy_blocks",
363358
value<bool>(&configured.chain.easy_blocks),
364-
"Allow minimum difficulty blocks, defaults to false (use true for testnet)."
359+
"Allow minimum difficulty blocks, defaults to false."
365360
)
366361
(
367362
"fork.bip16",
@@ -406,24 +401,36 @@ options_metadata parser::load_settings()
406401
//// "The time limit for block response during initial block download, defaults to 5."
407402
////)
408403
(
409-
"node.block_poll_seconds",
410-
value<uint32_t>(&configured.node.block_poll_seconds),
411-
"The time period for block polling after initial block download, defaults to 1 (0 disables)."
404+
"node.block_latency_seconds",
405+
value<uint32_t>(&configured.node.block_latency_seconds),
406+
"The time to wait for a requested block, defaults to 60."
412407
)
413408
(
414409
/* Internally this is blockchain, but it is conceptually a node setting. */
415-
"node.minimum_byte_fee_satoshis",
416-
value<float>(&configured.chain.minimum_byte_fee_satoshis),
417-
"The minimum fee per byte required for transaction acceptance, defaults to 1."
410+
"node.notify_limit_hours",
411+
value<uint32_t>(&configured.chain.notify_limit_hours),
412+
"Disable relay when top block age exceeds, defaults to 24 (0 disables)."
413+
)
414+
(
415+
/* Internally this is blockchain, but it is conceptually a node setting. */
416+
"node.byte_fee_satoshis",
417+
value<float>(&configured.chain.byte_fee_satoshis),
418+
"The minimum fee per byte, cumulative for conflicts, defaults to 1."
419+
)
420+
(
421+
/* Internally this is blockchain, but it is conceptually a node setting. */
422+
"node.sigop_fee_satoshis",
423+
value<float>(&configured.chain.sigop_fee_satoshis),
424+
"The minimum fee per sigop, additional to byte fee, defaults to 100."
425+
)
426+
(
427+
/* Internally this is blockchain, but it is conceptually a node setting. */
428+
"node.minimum_output_satoshis",
429+
value<uint64_t>(&configured.chain.minimum_output_satoshis),
430+
"The minimum output value, defaults to 500."
418431
)
419-
////(
420-
//// /* Internally this blockchain, but it is conceptually a node setting. */
421-
//// "node.reject_conflicts",
422-
//// value<bool>(&configured.chain.reject_conflicts),
423-
//// "Retain only the first seen of conflicting transactions, defaults to true."
424-
////)
425432
(
426-
/* Internally this network, but it is conceptually a node setting. */
433+
/* Internally this is network, but it is conceptually a node setting. */
427434
"node.relay_transactions",
428435
value<bool>(&configured.network.relay_transactions),
429436
"Request that peers relay transactions, defaults to false."

0 commit comments

Comments
 (0)
Please sign in to comment.