aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/api/wallet.cpp4
-rw-r--r--src/wallet/wallet2.cpp6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 7120485d5..6200c7a1f 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1123,6 +1123,10 @@ UnsignedTransaction *WalletImpl::loadUnsignedTx(const std::string &unsigned_file
UnsignedTransactionImpl * transaction = new UnsignedTransactionImpl(*this);
if (!m_wallet->load_unsigned_tx(unsigned_filename, transaction->m_unsigned_tx_set)){
setStatusError(tr("Failed to load unsigned transactions"));
+ transaction->m_status = UnsignedTransaction::Status::Status_Error;
+ transaction->m_errorString = errorString();
+
+ return transaction;
}
// Check tx data and construct confirmation message
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index b85e805de..3e00369a8 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -13195,6 +13195,12 @@ bool wallet2::save_to_file(const std::string& path_to_file, const std::string& r
}
FILE *fp = fopen(path_to_file.c_str(), "w+");
+ if (!fp)
+ {
+ MERROR("Failed to open wallet file for writing: " << path_to_file << ": " << strerror(errno));
+ return false;
+ }
+
// Save the result b/c we need to close the fp before returning success/failure.
int write_result = PEM_write(fp, ASCII_OUTPUT_MAGIC.c_str(), "", (const unsigned char *) raw.c_str(), raw.length());
fclose(fp);