Browse Source

ensure psbt files always have correct extension

terminal
Craig Raw 4 years ago
parent
commit
9060a4b284
  1. 4
      src/main/java/com/sparrowwallet/sparrow/AppController.java
  2. 4
      src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java

4
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) {

4
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());

Loading…
Cancel
Save