From a97eebd068d46a1320a139f36a3696fefa771693 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Date: Sun, 14 Nov 2021 15:24:24 +0530 Subject: [PATCH] merge bitcoin#15039: Avoid leaking nLockTime fingerprint when anti-fee-sniping --- src/wallet/wallet.cpp | 2 +- test/functional/wallet_create_tx.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 688fc10004..6a033bdce4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3299,7 +3299,7 @@ static bool IsCurrentForAntiFeeSniping(interfaces::Chain::Lock& locked_chain) if (::ChainstateActive().IsInitialBlockDownload()) { return false; } - constexpr int64_t MAX_ANTI_FEE_SNIPING_TIP_AGE = 4 * 60; // in seconds + constexpr int64_t MAX_ANTI_FEE_SNIPING_TIP_AGE = 8 * 60 * 60; // in seconds if (::ChainActive().Tip()->GetBlockTime() < (GetTime() - MAX_ANTI_FEE_SNIPING_TIP_AGE)) { return false; } diff --git a/test/functional/wallet_create_tx.py b/test/functional/wallet_create_tx.py index 27dc0fb279..7dfabc96ad 100755 --- a/test/functional/wallet_create_tx.py +++ b/test/functional/wallet_create_tx.py @@ -19,6 +19,7 @@ class CreateTxWalletTest(BitcoinTestFramework): def run_test(self): self.log.info('Check that we have some (old) blocks and that anti-fee-sniping is disabled') + self.bump_mocktime(8 * 60 * 60 + 1) assert_equal(self.nodes[0].getblockchaininfo()['blocks'], 200) txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1) tx = self.nodes[0].decoderawtransaction(self.nodes[0].gettransaction(txid)['hex'])