@@ -420,7 +420,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
420
420
// throw exception in case of a empty request
421
421
std::string strRequestMutable = req->ReadBody ();
422
422
if (strRequestMutable.length () == 0 && uriParts.size () == 0 )
423
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Error: empty request" );
423
+ return RESTERR (req, HTTP_BAD_REQUEST , " Error: empty request" );
424
424
425
425
bool fInputParsed = false ;
426
426
bool fCheckMemPool = false ;
@@ -444,7 +444,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
444
444
std::string strOutput = uriParts[i].substr (uriParts[i].find (" -" )+1 );
445
445
446
446
if (!ParseInt32 (strOutput, &nOutput) || !IsHex (strTxid))
447
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Parse error" );
447
+ return RESTERR (req, HTTP_BAD_REQUEST , " Parse error" );
448
448
449
449
txid.SetHex (strTxid);
450
450
vOutPoints.push_back (COutPoint (txid, (uint32_t )nOutput));
@@ -453,7 +453,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
453
453
if (vOutPoints.size () > 0 )
454
454
fInputParsed = true ;
455
455
else
456
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Error: empty request" );
456
+ return RESTERR (req, HTTP_BAD_REQUEST , " Error: empty request" );
457
457
}
458
458
459
459
switch (rf) {
@@ -469,7 +469,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
469
469
if (strRequestMutable.size () > 0 )
470
470
{
471
471
if (fInputParsed ) // don't allow sending input over URI and HTTP RAW DATA
472
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Combination of URI scheme inputs and raw post data is not allowed" );
472
+ return RESTERR (req, HTTP_BAD_REQUEST , " Combination of URI scheme inputs and raw post data is not allowed" );
473
473
474
474
CDataStream oss (SER_NETWORK, PROTOCOL_VERSION);
475
475
oss << strRequestMutable;
@@ -478,14 +478,14 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
478
478
}
479
479
} catch (const std::ios_base::failure& e) {
480
480
// abort in case of unreadable binary data
481
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Parse error" );
481
+ return RESTERR (req, HTTP_BAD_REQUEST , " Parse error" );
482
482
}
483
483
break ;
484
484
}
485
485
486
486
case RF_JSON: {
487
487
if (!fInputParsed )
488
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , " Error: empty request" );
488
+ return RESTERR (req, HTTP_BAD_REQUEST , " Error: empty request" );
489
489
break ;
490
490
}
491
491
default : {
@@ -495,7 +495,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
495
495
496
496
// limit max outpoints
497
497
if (vOutPoints.size () > MAX_GETUTXOS_OUTPOINTS)
498
- return RESTERR (req, HTTP_INTERNAL_SERVER_ERROR , strprintf (" Error: max outpoints exceeded (max: %d, tried: %d)" , MAX_GETUTXOS_OUTPOINTS, vOutPoints.size ()));
498
+ return RESTERR (req, HTTP_BAD_REQUEST , strprintf (" Error: max outpoints exceeded (max: %d, tried: %d)" , MAX_GETUTXOS_OUTPOINTS, vOutPoints.size ()));
499
499
500
500
// check spentness and form a bitmap (as well as a JSON capable human-readable string representation)
501
501
vector<unsigned char > bitmap;
0 commit comments