@ -890,15 +890,25 @@ Connection::~Connection() {
void Connection : : doRPC ( const QJsonValue & payload , const std : : function < void ( QJsonValue ) > & cb ,
void Connection : : doRPC ( const QJsonValue & payload , const std : : function < void ( QJsonValue ) > & cb ,
const std : : function < void ( QNetworkReply * , const QJsonValue & ) > & ne ) {
const std : : function < void ( QNetworkReply * , const QJsonValue & ) > & ne ) {
if ( shutdownInProgress ) {
if ( shutdownInProgress ) {
qDebug ( ) < < __func__ < < " : Ignoring RPC because shutdown in progress" ;
DEBUG ( " Ignoring RPC because shutdown in progress " ) ;
return ;
return ;
}
}
if ( payload . isNull ( ) | | payload . isUndefined ( ) ) {
if ( payload . isNull ( ) | | payload . isUndefined ( ) ) {
qDebug ( ) < < " no payload! ignoring " ;
DEBUG ( " no payload! ignoring " ) ;
return ;
return ;
} else {
} else {
qDebug ( ) < < __func__ < < " : " < < payload [ " method " ] . toString ( ) < < payload ;
// this will match importprivkey z_importkey z_importviewingkey importwallet z_importwallet
// and some other RPCs that have no GUI
// So this code ends up redacting payloads which contain private keys and filenames which contain private keys
QRegExp re ( " import " ) ;
//DEBUG("payload.toString==" << payload["method"].toString());
//DEBUG("payload.toString.indexIn==" << re.indexIn(payload["method"].toString()) );
if ( re . indexIn ( payload [ " method " ] . toString ( ) ) = = - 1 ) {
DEBUG ( payload [ " method " ] . toString ( ) < < payload ) ;
} else {
DEBUG ( payload [ " method " ] . toString ( ) < < " PAYLOAD REDACTED " ) ;
}
}
}
QJsonDocument jd_rpc_call ( payload . toObject ( ) ) ;
QJsonDocument jd_rpc_call ( payload . toObject ( ) ) ;
@ -909,7 +919,7 @@ void Connection::doRPC(const QJsonValue& payload, const std::function<void(QJson
QObject : : connect ( reply , & QNetworkReply : : finished , [ = ] {
QObject : : connect ( reply , & QNetworkReply : : finished , [ = ] {
reply - > deleteLater ( ) ;
reply - > deleteLater ( ) ;
if ( shutdownInProgress ) {
if ( shutdownInProgress ) {
// Ignoring callback because shutdown in progress
DEBUG ( " Ignoring callback because shutdown in progress " ) ;
return ;
return ;
}
}