Add locks to ZHash
This commit is contained in:
parent
bebd7aea90
commit
b7cb5f2361
1 changed files with 18 additions and 10 deletions
28
Program.cs
28
Program.cs
|
@ -769,9 +769,13 @@ namespace Bot
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != "")
|
lock(_lock)
|
||||||
CalculateKey(value);
|
{
|
||||||
else NewKey();
|
|
||||||
|
if (value != "")
|
||||||
|
CalculateKey(value);
|
||||||
|
else NewKey();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -811,13 +815,17 @@ namespace Bot
|
||||||
|
|
||||||
public void NewKey()
|
public void NewKey()
|
||||||
{
|
{
|
||||||
_key = "".PadLeft(10, '0');
|
lock(_lock)
|
||||||
_key += ":";
|
{
|
||||||
_key += "".PadRight(4, '0');
|
|
||||||
_key += ":";
|
_key = "".PadLeft(10, '0');
|
||||||
_key += "".PadRight(6, '0');
|
_key += ":";
|
||||||
_key += ":";
|
_key += "".PadRight(4, '0');
|
||||||
_key += "".PadRight(8, '0');
|
_key += ":";
|
||||||
|
_key += "".PadRight(6, '0');
|
||||||
|
_key += ":";
|
||||||
|
_key += "".PadRight(8, '0');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetKey(string Key)
|
public void SetKey(string Key)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue