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
3 changes: 3 additions & 0 deletions include/bitcoin/node/protocols/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class BCN_API protocol
/// The candidate|confirmed chain is current.
virtual bool is_current_chain(bool confirmed) const NOEXCEPT;

/// The minimum fee rate (satoshis/kvB) to relay, max_money if not pooling.
virtual uint64_t minimum_fee_rate() const NOEXCEPT;

/// Zulu time at which the node started.
virtual time_t start_time() const NOEXCEPT;

Expand Down
6 changes: 6 additions & 0 deletions src/protocols/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ bool protocol::is_current_chain(bool confirmed) const NOEXCEPT
return session_->is_current_chain(confirmed);
}

uint64_t protocol::minimum_fee_rate() const NOEXCEPT
{
return is_current_chain(true) ? node_settings().minimum_fee_rate_() :
system_settings().max_money();
}

time_t protocol::start_time() const NOEXCEPT
{
return session_->start_time();
Expand Down
7 changes: 2 additions & 5 deletions src/protocols/protocol_transaction_out_70013.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,12 @@ void protocol_transaction_out_70013::start() NOEXCEPT
// Outbound (feefilter).
// ----------------------------------------------------------------------------

// bip133: a tx below the advertised rate is not announced to us, and the
// maximum suppresses relay entirely, as txs are not accepted when not current.
// bip133: a tx below the advertised rate is not announced to us.
void protocol_transaction_out_70013::do_send_fee_filter() NOEXCEPT
{
BC_ASSERT(stranded());

const auto minimum = is_current_chain(true) ?
node_settings().minimum_fee_rate_() :
system_settings().max_money();
const auto minimum = minimum_fee_rate();

if (minimum == sent_fee_)
return;
Expand Down
Loading