From a432a13d5ecff177551cc4047ef501a18b84cbbf Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Fri, 23 Jan 2026 23:45:05 +0100 Subject: [PATCH 1/2] Transaction: adjust constant `DEFAULT_TX_FEE_RATE` Mainly this default fee is relevant for key rotations. Fee asserts in three tests are adjusted as well. In `lowerThanDefaultFeeRate()`, the feeFactor is adjusted so that the calculated fee isn't clamped to the reference minimum fee rate. --- .../main/java/org/bitcoinj/core/Transaction.java | 4 ++-- .../test/java/org/bitcoinj/wallet/WalletTest.java | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index b81ad35731b..3525c755bb2 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -155,9 +155,9 @@ private static int sortableBlockHeight(Transaction tx) { /** * If using this fee rate, transactions will get confirmed within the next couple of blocks. - * This should be adjusted from time to time. Last adjustment: February 2017. + * This should be adjusted from time to time. Last adjustment: January 2026. */ - public static final Coin DEFAULT_TX_FEE_RATE = Coin.valueOf(100_000); // per vkB + public static final Coin DEFAULT_TX_FEE_RATE = Coin.valueOf(10_000); // per vkB /** @deprecated use {@link #DEFAULT_TX_FEE_RATE} */ @Deprecated diff --git a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java index 5316ebb0d38..a02cf47f8fd 100644 --- a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java +++ b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java @@ -2647,13 +2647,13 @@ public void witnessTransactionGetFeeTest() throws Exception { @Test public void lowerThanDefaultFeeRate() throws InsufficientMoneyException { - int feeFactor = 200; + int feeFactor = 10; Coin fee = Transaction.DEFAULT_TX_FEE_RATE.divide(feeFactor); receiveATransactionAmount(wallet, myAddress, Coin.COIN); SendRequest req = SendRequest.to(myAddress, Coin.CENT); req.feePerKb = fee; wallet.completeTx(req); - assertEquals(Coin.valueOf(22700).divide(feeFactor), req.tx.getFee()); + assertEquals(Coin.valueOf(2_270).divide(feeFactor), req.tx.getFee()); wallet.commitTx(req.tx); SendRequest emptyReq = SendRequest.emptyWallet(myAddress); emptyReq.feePerKb = fee; @@ -2661,7 +2661,7 @@ public void lowerThanDefaultFeeRate() throws InsufficientMoneyException { emptyReq.emptyWallet = true; emptyReq.allowUnconfirmed(); wallet.completeTx(emptyReq); // resulting vsize ~339 - assertEquals(Coin.valueOf(171), emptyReq.tx.getFee()); + assertEquals(Coin.valueOf(3_420).divide(feeFactor), emptyReq.tx.getFee()); wallet.commitTx(emptyReq.tx); } @@ -2673,14 +2673,14 @@ public void higherThanDefaultFeeRate() throws InsufficientMoneyException { SendRequest req = SendRequest.to(myAddress, Coin.CENT); req.feePerKb = fee; wallet.completeTx(req); - assertEquals(Coin.valueOf(22700).multiply(feeFactor), req.tx.getFee()); + assertEquals(Coin.valueOf(2_270).multiply(feeFactor), req.tx.getFee()); wallet.commitTx(req.tx); SendRequest emptyReq = SendRequest.emptyWallet(myAddress); emptyReq.feePerKb = fee; emptyReq.emptyWallet = true; emptyReq.allowUnconfirmed(); wallet.completeTx(emptyReq); - assertEquals(Coin.valueOf(342000), emptyReq.tx.getFee()); + assertEquals(Coin.valueOf(3_420).multiply(feeFactor), emptyReq.tx.getFee()); wallet.commitTx(emptyReq.tx); } @@ -2900,7 +2900,7 @@ public void keyRotationRandom() throws Exception { Transaction tx = broadcaster.waitForTransactionAndSucceed(); final Coin THREE_CENTS = CENT.add(CENT).add(CENT); - assertEquals(Coin.valueOf(49100), tx.getFee()); + assertEquals(Coin.valueOf(4910), tx.getFee()); assertEquals(THREE_CENTS, tx.getValueSentFromMe(wallet)); assertEquals(THREE_CENTS.subtract(tx.getFee()), tx.getValueSentToMe(wallet)); // TX sends to one of our addresses (for now we ignore married wallets). @@ -2924,7 +2924,7 @@ public void keyRotationRandom() throws Exception { assertNotNull(wallet.findKeyFromPubKeyHash(tx.getOutput(0).getScriptPubKey().getPubKeyHash(), toAddress.getOutputScriptType())); log.info("Unexpected thing: {}", tx); - assertEquals(Coin.valueOf(19300), tx.getFee()); + assertEquals(Coin.valueOf(1930), tx.getFee()); assertEquals(1, tx.getInputs().size()); assertEquals(1, tx.getOutputs().size()); assertEquals(CENT, tx.getValueSentFromMe(wallet)); From cacc30003b23125428bc1228480d6241f03cfdb5 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 23 Jan 2026 13:49:32 -0800 Subject: [PATCH 2/2] build-gradle.yml: update Gradle to 8.14.4 --- .github/workflows/build-gradle.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build-gradle.yml index e2711f02849..e2fd9bd77c3 100644 --- a/.github/workflows/build-gradle.yml +++ b/.github/workflows/build-gradle.yml @@ -11,18 +11,18 @@ jobs: os: [ubuntu-24.04, macOS-15, macOS-15-intel, windows-2022] java: ['17', '21', '25'] distribution: ['temurin'] - gradle: ['8.14.3', '9.2.1'] + gradle: ['8.14.4', '9.2.1'] exclude: # Java 25+ requires Gradle 9.1+ - java: '25' - gradle: '8.14.3' + gradle: '8.14.4' # Exclude older versions of Gradle on macOS and Windows - os: macOS-15 - gradle: '8.14.3' + gradle: '8.14.4' - os: macOS-15-intel - gradle: '8.14.3' + gradle: '8.14.4' - os: windows-2022 - gradle: '8.14.3' + gradle: '8.14.4' fail-fast: false env: # Use env variable to specify the JDK version to use for the `testMinJdk` Gradle option