From 5456b345312857981cb426712f0665800c682e09 Mon Sep 17 00:00:00 2001 From: Jarol Rodriguez Date: Tue, 6 Apr 2021 23:01:10 -0400 Subject: [PATCH] rpc: add ban_duration field to listbanned --- src/rpc/net.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 27ff6bcdafc..b11138cacc9 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -752,6 +752,7 @@ static RPCHelpMan listbanned() {RPCResult::Type::STR, "address", "The IP/Subnet of the banned node"}, {RPCResult::Type::NUM_TIME, "ban_created", "The " + UNIX_EPOCH_TIME + " the ban was created"}, {RPCResult::Type::NUM_TIME, "banned_until", "The " + UNIX_EPOCH_TIME + " the ban expires"}, + {RPCResult::Type::NUM_TIME, "ban_duration", "The ban duration, in seconds"}, }}, }}, RPCExamples{ @@ -776,6 +777,7 @@ static RPCHelpMan listbanned() rec.pushKV("address", entry.first.ToString()); rec.pushKV("ban_created", banEntry.nCreateTime); rec.pushKV("banned_until", banEntry.nBanUntil); + rec.pushKV("ban_duration", (banEntry.nBanUntil - banEntry.nCreateTime)); bannedAddresses.push_back(rec); }