Skip to content

Commit 183fd1b

Browse files
authored
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

Lines changed: 7 additions & 7 deletions
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], [[email protected]])
16+
AC_INIT([libbitcoin-node], [3.2.0], [[email protected]])
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 12 additions & 8 deletions
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

Lines changed: 10 additions & 4 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)