File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ static RPCHelpMan waitfornewblock()
296296 int timeout = 0 ;
297297 if (!request.params [0 ].isNull ())
298298 timeout = request.params [0 ].getInt <int >();
299+ if (timeout < 0 ) throw JSONRPCError (RPC_MISC_ERROR, " Negative timeout" );
299300
300301 CUpdatedBlock block;
301302 {
@@ -343,6 +344,7 @@ static RPCHelpMan waitforblock()
343344
344345 if (!request.params [1 ].isNull ())
345346 timeout = request.params [1 ].getInt <int >();
347+ if (timeout < 0 ) throw JSONRPCError (RPC_MISC_ERROR, " Negative timeout" );
346348
347349 CUpdatedBlock block;
348350 {
@@ -391,6 +393,7 @@ static RPCHelpMan waitforblockheight()
391393
392394 if (!request.params [1 ].isNull ())
393395 timeout = request.params [1 ].getInt <int >();
396+ if (timeout < 0 ) throw JSONRPCError (RPC_MISC_ERROR, " Negative timeout" );
394397
395398 CUpdatedBlock block;
396399 {
You can’t perform that action at this time.
0 commit comments