diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index ae4b39fb..f5bb0237 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -447,6 +447,10 @@ public class AppController implements Initializable { File file = fileChooser.showSaveDialog(window); if(file != null) { + if(!saveTx && !file.getName().toLowerCase().endsWith(".psbt")) { + file = new File(file.getAbsolutePath() + ".psbt"); + } + try { try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) { if(saveTx) { diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 6d1941be..01e8c693 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -665,6 +665,10 @@ public class HeadersController extends TransactionFormController implements Init File file = fileChooser.showSaveDialog(window); if(file != null) { + if(!file.getName().toLowerCase().endsWith(".psbt")) { + file = new File(file.getAbsolutePath() + ".psbt"); + } + try { try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) { writer.print(headersForm.getPsbt().toBase64String());