Skip to content

Commit

Permalink
Increase fees in accordance with Qtum Core policy
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Dec 4, 2023
1 parent 4c4e807 commit 3fe86e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bitcoin/src/blockdata/script/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ impl Script {
}

/// Returns the minimum value an output with this script should have in order to be
/// broadcastable on today's Bitcoin network.
/// broadcastable on today's Qtum network.
pub fn dust_value(&self) -> crate::Amount {
// This must never be lower than Bitcoin Core's GetDustThreshold() (as of v0.21) as it may
// This must never be lower than Qtum Core's GetDustThreshold() (as of v24.1) as it may
// otherwise allow users to create transactions which likely can never be broadcast/confirmed.
let sats = DUST_RELAY_TX_FEE as u64 / 1000 * // The default dust relay fee is 3000 satoshi/kB (i.e. 3 sat/vByte)
let sats = DUST_RELAY_TX_FEE as u64 / 1000 * // The default dust relay fee is 400000 satoshi/kB (i.e. 400 sat/vByte)
if self.is_op_return() {
0
} else if self.is_witness_program() {
Expand Down
9 changes: 6 additions & 3 deletions bitcoin/src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ pub const MIN_STANDARD_TX_NONWITNESS_SIZE: u32 = 82;
pub const MAX_STANDARD_TX_SIGOPS_COST: u32 = MAX_BLOCK_SIGOPS_COST as u32 / 5;

/// The minimum incremental *feerate* (despite the name), in sats per virtual kilobyte for RBF.
pub const DEFAULT_INCREMENTAL_RELAY_FEE: u32 = 1_000;
// Qtum: https://github.com/qtumproject/qtum/blob/time/qtumcore24/src/policy/policy.h#L35
pub const DEFAULT_INCREMENTAL_RELAY_FEE: u32 = 10_000;

/// The number of bytes equivalent per signature operation. Affects transaction relay through the
/// virtual size computation.
pub const DEFAULT_BYTES_PER_SIGOP: u32 = 20;

/// The minimum feerate, in sats per kilo-virtualbyte, for defining dust. An output is considered
/// dust if spending it under this feerate would cost more in fee.
pub const DUST_RELAY_TX_FEE: u32 = 3_000;
// Qtum: https://github.com/qtumproject/qtum/blob/time/qtumcore24/src/policy/policy.h#L55
pub const DUST_RELAY_TX_FEE: u32 = 400_000;

/// Minimum feerate, in sats per virtual kilobyte, for a transaction to be relayed by most nodes on
/// the network.
pub const DEFAULT_MIN_RELAY_TX_FEE: u32 = 1_000;
// Qtum: https://github.com/qtumproject/qtum/blob/time/qtumcore24/src/policy/policy.h#L57
pub const DEFAULT_MIN_RELAY_TX_FEE: u32 = 400_000;

/// Default number of hours for an unconfirmed transaction to expire in most of the network nodes'
/// mempools.
Expand Down

0 comments on commit 3fe86e0

Please sign in to comment.