diff --git a/src/hush_utils.h b/src/hush_utils.h index 1b1cb2eeb..6241b93ba 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1383,8 +1383,14 @@ void hush_configfile(char *symbol,uint16_t rpcport) #endif } else { _hush_userpass(myusername,mypassword,fp); - mapArgs["-rpcpassword"] = mypassword; - mapArgs["-rpcusername"] = myusername; + // Feed the credentials read by InitRPCAuthentication (httprpc.cpp) and the + // CLI (bitcoin-cli.cpp) -- both read "-rpcuser"/"-rpcpassword". Use SoftSetArg + // so a value passed on the command line (or an explicit -rpcuser/-rpcpassword) + // still wins: the old direct assignment silently overwrote a command-line + // -rpcpassword on every restart once this conf existed, and the username was + // written to a misspelled "-rpcusername" key that nothing ever reads. + SoftSetArg("-rpcpassword", mypassword); + SoftSetArg("-rpcuser", myusername); fclose(fp); } }