diff options
author | Jarol Rodriguez <jarolrod@tutanota.com> | 2021-04-06 23:01:10 -0400 |
---|---|---|
committer | Jarol Rodriguez <jarolrod@tutanota.com> | 2021-04-06 23:01:10 -0400 |
commit | 5456b345312857981cb426712f0665800c682e09 (patch) | |
tree | b9113cbd60aa9a2532059d75446994827880ee7a /src/rpc | |
parent | c95c61657afd058b46549fb3d65633d7c736f5fc (diff) | |
download | bitcoin-5456b345312857981cb426712f0665800c682e09.tar.xz |
rpc: add ban_duration field to listbanned
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/net.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 27ff6bcdaf..b11138cacc 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); } |