Browse Source

Test if there is a btcaddress every time a user is generated in case a previous call to test_address failed

master
Con Kolivas 9 years ago
parent
commit
2c6b550732
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -4716,10 +4716,10 @@ static user_instance_t *generate_user(ckpool_t *ckp, stratum_instance_t *client,
__inc_worker(sdata,user, worker); __inc_worker(sdata,user, worker);
ck_wunlock(&sdata->instance_lock); ck_wunlock(&sdata->instance_lock);
if (new_user && !ckp->proxy) {
/* Is this a btc address based username? */ /* Is this a btc address based username? */
if (len > 26 && len < 35) if (!ckp->proxy && (new_user || !user->btcaddress) && (len > 26 && len < 35))
user->btcaddress = test_address(ckp, username); user->btcaddress = test_address(ckp, username);
if (new_user) {
LOGNOTICE("Added new user %s%s", username, user->btcaddress ? LOGNOTICE("Added new user %s%s", username, user->btcaddress ?
" as address based registration" : ""); " as address based registration" : "");
} }
@ -6123,10 +6123,10 @@ static user_instance_t *generate_remote_user(ckpool_t *ckp, const char *workerna
user = get_create_user(ckp, sdata, username, &new_user); user = get_create_user(ckp, sdata, username, &new_user);
if (new_user && !ckp->proxy) {
/* Is this a btc address based username? */ /* Is this a btc address based username? */
if (len > 26 && len < 35) if (!ckp->proxy && (new_user || !user->btcaddress) && (len > 26 && len < 35))
user->btcaddress = test_address(ckp, username); user->btcaddress = test_address(ckp, username);
if (new_user) {
LOGNOTICE("Added new remote user %s%s", username, user->btcaddress ? LOGNOTICE("Added new remote user %s%s", username, user->btcaddress ?
" as address based registration" : ""); " as address based registration" : "");
} }

Loading…
Cancel
Save