Electroneum
Loading...
Searching...
No Matches
tools::wallet_keys_unlocker Class Reference

#include <wallet2.h>

Public Member Functions

 wallet_keys_unlocker (wallet2 &w, const boost::optional< tools::password_container > &password)
 wallet_keys_unlocker (wallet2 &w, bool locked, const epee::wipeable_string &password)
 ~wallet_keys_unlocker ()

Detailed Description

Definition at line 111 of file wallet2.h.

Constructor & Destructor Documentation

◆ wallet_keys_unlocker() [1/2]

tools::wallet_keys_unlocker::wallet_keys_unlocker ( wallet2 & w,
const boost::optional< tools::password_container > & password )

Definition at line 1034 of file wallet2.cpp.

1034 :
1035 w(w),
1036 locked(password != boost::none)
1037{
1038 if (!locked || w.is_unattended() || w.ask_password() != tools::wallet2::AskPasswordToDecrypt || w.watch_only())
1039 {
1040 locked = false;
1041 return;
1042 }
1043 const epee::wipeable_string pass = password->password();
1044 w.generate_chacha_key_from_password(pass, key);
1045 w.decrypt_keys(key);
1046}
@ AskPasswordToDecrypt
Definition wallet2.h:228

◆ wallet_keys_unlocker() [2/2]

tools::wallet_keys_unlocker::wallet_keys_unlocker ( wallet2 & w,
bool locked,
const epee::wipeable_string & password )

Definition at line 1048 of file wallet2.cpp.

1048 :
1049 w(w),
1050 locked(locked)
1051{
1052 if (!locked)
1053 return;
1054 w.generate_chacha_key_from_password(password, key);
1055 w.decrypt_keys(key);
1056}

◆ ~wallet_keys_unlocker()

tools::wallet_keys_unlocker::~wallet_keys_unlocker ( )

Definition at line 1058 of file wallet2.cpp.

1059{
1060 if (!locked)
1061 return;
1062 try { w.encrypt_keys(key); }
1063 catch (...)
1064 {
1065 MERROR("Failed to re-encrypt wallet keys");
1066 // do not propagate through dtor, we'd crash
1067 }
1068}
#define MERROR(x)
Definition misc_log_ex.h:73

The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/wallet/wallet2.h
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/wallet/wallet2.cpp