File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -416,10 +416,25 @@ class MinerCLI
416
416
exit (-1 );
417
417
}
418
418
string mAcct = ProgOpt::Get (" 0xBitcoin" , " MinerAcct" );
419
- string notset (" 0x...." );
420
- if (" " == mAcct || notset == mAcct .substr (0 , notset.length ()))
419
+ LowerCase (mAcct );
420
+ u256 mAcctNum ;
421
+ try
421
422
{
422
- LogS << " Please set 'MinerAcct' in tokenminer.ini to a valid ETH account" ;
423
+ mAcctNum = u256 (mAcct );
424
+ }
425
+ catch (...)
426
+ {
427
+ LogS << " 'MinerAcct' contains invalid characters in tokenminer.ini" ;
428
+ exit (0 );
429
+ }
430
+ if (mAcct .substr (0 , 2 ) != " 0x" )
431
+ {
432
+ LogS << " Invalid 'MinerAcct' in tokenminer.ini - Miner account should start with '0x'" ;
433
+ exit (0 );
434
+ }
435
+ if (mAcctNum == 0 || mAcct .length () != 42 )
436
+ {
437
+ LogS << " Invalid 'MinerAcct' in tokenminer.ini" ;
423
438
exit (0 );
424
439
}
425
440
LogD << " " ;
You can’t perform that action at this time.
0 commit comments