diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 87642d8..019bf29 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -160,6 +160,7 @@ namespace monero { MoneroWallet::~MoneroWallet() { cout << "~MoneroWallet()" << endl; + close(); } // TODO: switch this to setDaemonConnection(MoneroDaemonRpc& daemonConnection) @@ -402,6 +403,21 @@ namespace monero { return iter == unlockedBalancePerSubaddress.end() ? 0 : iter->second.first; } + void MoneroWallet::save() { + cout << "save()" << endl; + save(nullptr, nullptr); + } + + void MoneroWallet::save(string path, string password) { + cout << "save(" << path << ", " << password << ")" << endl; + throw runtime_error("Not implemented"); + } + + void MoneroWallet::close() { + cout << "close()" << endl; + throw runtime_error("Not implemented"); + } + // ------------------------------- PRIVATE HELPERS ---------------------------- MoneroSyncResult MoneroWallet::syncAux(uint64_t* startHeight, uint64_t* endHeight, MoneroSyncListener* listener) { diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index 62c3fb4..5c8ab49 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -1102,6 +1102,27 @@ namespace monero { // */ // public void stopMining(); + /** + * Re-save the wallet at its current path. + * + * Throws an exception if the wallet was not loaded from a path and has not + * been saved to an explicit path. + */ + void save(); + + /** + * Save the wallet at the given path. + * + * @param path is the path to save the wallet at + * @param password is the password to encrypt the wallet + */ + void save(string path, string password); + + /** + * Close the wallet. + */ + void close(); + // --------------------------------- PRIVATE -------------------------------- private: