From 2e9d62a9c7ea7b992bd21585b386ddad9ff94d55 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 12 May 2021 21:10:18 +0200 Subject: [PATCH] blockdata/script: use policy's constant in dust computation Signed-off-by: Antoine Poinsot --- src/blockdata/script.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 42ceb6b6..8d7aa83f 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -33,6 +33,7 @@ use hash_types::{PubkeyHash, WPubkeyHash, ScriptHash, WScriptHash}; use blockdata::opcodes; use consensus::{encode, Decodable, Encodable}; use hashes::{Hash, hex}; +use policy::DUST_RELAY_TX_FEE; #[cfg(feature="bitcoinconsensus")] use bitcoinconsensus; #[cfg(feature="bitcoinconsensus")] use std::convert; #[cfg(feature="bitcoinconsensus")] use OutPoint; @@ -412,7 +413,7 @@ impl Script { // This must never be lower than Bitcoin Core's GetDustThreshold() (as of v0.21) as it may // otherwise allow users to create transactions which likely can never be // broadcasted/confirmed. - 3 * // The default dust relay fee is 3000 satoshi/kB (ie 3 sat/vByte) + DUST_RELAY_TX_FEE as u64 / 1000 * // The default dust relay fee is 3000 satoshi/kB (ie 3 sat/vByte) if self.is_op_return() { 0 } else if self.is_witness_program() {