mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 18:39:59 +01:00
p2p, rpc: don't allow past absolute timestamp in setban
This commit is contained in:
@@ -741,6 +741,10 @@ static RPCHelpMan setban()
|
||||
|
||||
const bool absolute{request.params[3].isNull() ? false : request.params[3].get_bool()};
|
||||
|
||||
if (absolute && banTime < GetTime()) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Error: Absolute timestamp is in the past");
|
||||
}
|
||||
|
||||
if (isSubnet) {
|
||||
node.banman->Ban(subNet, banTime, absolute);
|
||||
if (node.connman) {
|
||||
|
||||
Reference in New Issue
Block a user