diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/BitcoindDaemon.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/BitcoindDaemon.java index 4e340877c1..dd321426b2 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/BitcoindDaemon.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/BitcoindDaemon.java @@ -38,20 +38,16 @@ public BitcoindDaemon(JsonRpcClient rpcClient) { } public void createOrLoadWallet(String walletName, Optional passphrase) { - createOrLoadWallet(walletName, passphrase, true, false, false); - } - - public void createOrLoadLegacyWallet(String walletName, Optional passphrase) { - createOrLoadWallet(walletName, passphrase, false, false, false); + createOrLoadWallet(walletName, passphrase, false, false); } public void createOrLoadWatchOnlyWallet(String walletName) { - createOrLoadWallet(walletName, Optional.empty(), true, true, true); + createOrLoadWallet(walletName, Optional.empty(), true, true); } - private void createOrLoadWallet(String walletName, Optional passphrase, boolean descriptors, boolean disablePrivateKeys, boolean blank) { + private void createOrLoadWallet(String walletName, Optional passphrase, boolean disablePrivateKeys, boolean blank) { try { - createWallet(walletName, passphrase.orElse(""), descriptors, disablePrivateKeys, blank); + createWallet(walletName, passphrase.orElse(""), disablePrivateKeys, blank); } catch (RpcCallFailureException e) { if (doesWalletExist(e)) { List loadedWallets = listWallets(); @@ -117,7 +113,11 @@ private static List listWalletsWithRpcClient(JsonRpcClient rpcClient) { } public String sendRawTransaction(String hexString) { - var request = new BitcoindSendRawTransactionRpcCall.Request(hexString); + return sendRawTransaction(hexString, null); + } + + public String sendRawTransaction(String hexString, String maxBurnAmount) { + var request = new BitcoindSendRawTransactionRpcCall.Request(hexString, maxBurnAmount); var rpcCall = new BitcoindSendRawTransactionRpcCall(request); return rpcClient.call(rpcCall).getResult(); } @@ -147,10 +147,9 @@ private boolean doesWalletExist(RpcCallFailureException e) { return e.getMessage().contains("Database already exists."); } - private void createWallet(String walletName, String passphrase, boolean descriptors, boolean disablePrivateKeys, boolean blank) { + private void createWallet(String walletName, String passphrase, boolean disablePrivateKeys, boolean blank) { var request = BitcoindCreateWalletRpcCall.Request.builder() .walletName(walletName) - .descriptors(descriptors) .disablePrivateKeys(disablePrivateKeys) .blank(blank) .passphrase(passphrase) diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindCreateWalletRpcCall.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindCreateWalletRpcCall.java index 3f6050ae23..9537ef5fe3 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindCreateWalletRpcCall.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindCreateWalletRpcCall.java @@ -39,7 +39,6 @@ public static class Request { private String passphrase; @Json(name = "avoid_reuse") private Boolean avoidReuse; - private boolean descriptors; } public BitcoindCreateWalletRpcCall(Request request) { diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindSendRawTransactionRpcCall.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindSendRawTransactionRpcCall.java index 2fd3024ab7..28eb73b2c7 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindSendRawTransactionRpcCall.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/calls/BitcoindSendRawTransactionRpcCall.java @@ -32,9 +32,12 @@ public class BitcoindSendRawTransactionRpcCall extends DaemonRpcCall range; private Integer next; + @Json(name = "next_index") + private Integer nextIndex; } diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetBalancesResponse.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetBalancesResponse.java index 2df43a4b38..02082af04c 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetBalancesResponse.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetBalancesResponse.java @@ -27,5 +27,7 @@ public static class Result { private BitcoindGetMineBalancesResponse mine; @Json(name = "watchonly") private BitcoindGetMineBalancesResponse watchOnly; + @Json(name = "lastprocessedblock") + private BitcoindGetLastProcessedBlockBalancesResponse lastProcessedBlock; } } diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetLastProcessedBlockBalancesResponse.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetLastProcessedBlockBalancesResponse.java new file mode 100644 index 0000000000..212bcf5489 --- /dev/null +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindGetLastProcessedBlockBalancesResponse.java @@ -0,0 +1,9 @@ +package bisq.wallets.bitcoind.rpc.responses; + +import lombok.Getter; + +@Getter +public class BitcoindGetLastProcessedBlockBalancesResponse { + private String hash; + long height; +} diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindListTransactionsResponse.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindListTransactionsResponse.java index ded7429aae..bca0d211a4 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindListTransactionsResponse.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindListTransactionsResponse.java @@ -32,6 +32,8 @@ public class BitcoindListTransactionsResponse extends JsonRpcResponse parentDescs; private String category; private double amount; private String label; @@ -46,6 +48,8 @@ public static class Entry implements TransactionInfo { private int blocktime; @Json(name = "txid") private String txId; + @Json(name = "wtxid") + private String wtxId; private String[] walletconflicts; private int time; private int timereceived; diff --git a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindWalletProcessPsbtResponse.java b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindWalletProcessPsbtResponse.java index 71895f011e..9d104d72ea 100644 --- a/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindWalletProcessPsbtResponse.java +++ b/wallets/bitcoind/src/main/java/bisq/wallets/bitcoind/rpc/responses/BitcoindWalletProcessPsbtResponse.java @@ -26,5 +26,6 @@ public class BitcoindWalletProcessPsbtResponse extends JsonRpcResponse { @Getter public static class Result { - protected String warning; + protected List warnings = Collections.emptyList(); public boolean hasWarning() { - return !warning.isEmpty(); + return !warnings.isEmpty(); } } } diff --git a/wallets/elementsd/src/main/java/bisq/wallets/elementsd/rpc/ElementsdDaemon.java b/wallets/elementsd/src/main/java/bisq/wallets/elementsd/rpc/ElementsdDaemon.java index b4ac2bc03c..489954c3cb 100644 --- a/wallets/elementsd/src/main/java/bisq/wallets/elementsd/rpc/ElementsdDaemon.java +++ b/wallets/elementsd/src/main/java/bisq/wallets/elementsd/rpc/ElementsdDaemon.java @@ -38,7 +38,7 @@ public ElementsdDaemon(JsonRpcClient rpcClient) { } public void createOrLoadWallet(String walletName, Optional passphrase) { - bitcoindDaemon.createOrLoadLegacyWallet(walletName, passphrase); + throw new UnsupportedOperationException("Bitcoin Core 25.0 removed legacy wallet support."); } public ElementsdDecodeRawTransactionResponse decodeRawTransaction(String txInHex) { diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java index a77221171e..5d49e5f872 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java @@ -65,7 +65,7 @@ public List mineOneBlock() throws InterruptedException { return mineBlocks(1); } - public List mineBlocks(int numberOfBlocks) throws InterruptedException { + public List mineBlocks(int numberOfBlocks) { return remoteBitcoind.mineBlocks(numberOfBlocks); }