From 2c6b5507323f45f2a165e83e82da627f252de51d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 4 Feb 2016 12:00:42 +1100 Subject: [PATCH] Test if there is a btcaddress every time a user is generated in case a previous call to test_address failed --- src/stratifier.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 623b2400..c1912e71 100644 --- a/src/stratifier.c +++ b/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); ck_wunlock(&sdata->instance_lock); - if (new_user && !ckp->proxy) { - /* Is this a btc address based username? */ - if (len > 26 && len < 35) - user->btcaddress = test_address(ckp, username); + /* Is this a btc address based username? */ + if (!ckp->proxy && (new_user || !user->btcaddress) && (len > 26 && len < 35)) + user->btcaddress = test_address(ckp, username); + if (new_user) { LOGNOTICE("Added new user %s%s", username, user->btcaddress ? " 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); - if (new_user && !ckp->proxy) { - /* Is this a btc address based username? */ - if (len > 26 && len < 35) - user->btcaddress = test_address(ckp, username); + /* Is this a btc address based username? */ + if (!ckp->proxy && (new_user || !user->btcaddress) && (len > 26 && len < 35)) + user->btcaddress = test_address(ckp, username); + if (new_user) { LOGNOTICE("Added new remote user %s%s", username, user->btcaddress ? " as address based registration" : ""); }