mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46: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);
|
||||
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) {
|
||||
|
|
|
@ -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…
Reference in a new issue