mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
ensure psbt files always have correct extension
This commit is contained in:
parent
759de8e047
commit
9060a4b284
2 changed files with 8 additions and 0 deletions
|
@ -447,6 +447,10 @@ public class AppController implements Initializable {
|
||||||
|
|
||||||
File file = fileChooser.showSaveDialog(window);
|
File file = fileChooser.showSaveDialog(window);
|
||||||
if(file != null) {
|
if(file != null) {
|
||||||
|
if(!saveTx && !file.getName().toLowerCase().endsWith(".psbt")) {
|
||||||
|
file = new File(file.getAbsolutePath() + ".psbt");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) {
|
try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) {
|
||||||
if(saveTx) {
|
if(saveTx) {
|
||||||
|
|
|
@ -665,6 +665,10 @@ public class HeadersController extends TransactionFormController implements Init
|
||||||
|
|
||||||
File file = fileChooser.showSaveDialog(window);
|
File file = fileChooser.showSaveDialog(window);
|
||||||
if(file != null) {
|
if(file != null) {
|
||||||
|
if(!file.getName().toLowerCase().endsWith(".psbt")) {
|
||||||
|
file = new File(file.getAbsolutePath() + ".psbt");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) {
|
try(PrintWriter writer = new PrintWriter(file, StandardCharsets.UTF_8)) {
|
||||||
writer.print(headersForm.getPsbt().toBase64String());
|
writer.print(headersForm.getPsbt().toBase64String());
|
||||||
|
|
Loading…
Reference in a new issue