mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
🐎 contains check for SendFunds before unique grabbed
This commit is contained in:
parent
8f47c12450
commit
3279835696
1 changed files with 6 additions and 0 deletions
|
|
@ -90,6 +90,12 @@ int_fast8_t Bank::SendFunds(const std::string &a_name, const std::string &b_name
|
||||||
{
|
{
|
||||||
return ErrorResponse::InvalidRequest;
|
return ErrorResponse::InvalidRequest;
|
||||||
}
|
}
|
||||||
|
//as first modify_if checks a_name and grabs unique lock
|
||||||
|
if (!Contains(b_name))
|
||||||
|
{
|
||||||
|
return ErrorResponse::UserNotFound;
|
||||||
|
}
|
||||||
|
|
||||||
int_fast8_t state = false;
|
int_fast8_t state = false;
|
||||||
{
|
{
|
||||||
std::shared_lock<std::shared_mutex> lock{send_funds_l}; //because SendFunds requires 3 locking operations
|
std::shared_lock<std::shared_mutex> lock{send_funds_l}; //because SendFunds requires 3 locking operations
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue