Skip to content

Commit 69e5470

Browse files
committed
Bugfix: RPC/blockchain: Use int32 for maxmempool param range checking
Since we immediately multiply by 1000000 without overflow checking, and even 2^31 is unreasonably large, just use int32_t for the range check, and immediately cast to int64 as before
1 parent 7c0773a commit 69e5470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rpc/mempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static RPCHelpMan maxmempool()
391391
},
392392
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
393393
{
394-
int64_t nSize = request.params[0].getInt<int64_t>();
394+
int64_t nSize = request.params[0].getInt<int32_t>();
395395
int64_t nMempoolSizeMax = nSize * 1000000;
396396

397397
CTxMemPool& mempool = EnsureAnyMemPool(request.context);

0 commit comments

Comments
 (0)