Skip to content

Commit 5456b34

Browse files
committed
rpc: add ban_duration field to listbanned
1 parent c95c616 commit 5456b34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpc/net.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ static RPCHelpMan listbanned()
752752
{RPCResult::Type::STR, "address", "The IP/Subnet of the banned node"},
753753
{RPCResult::Type::NUM_TIME, "ban_created", "The " + UNIX_EPOCH_TIME + " the ban was created"},
754754
{RPCResult::Type::NUM_TIME, "banned_until", "The " + UNIX_EPOCH_TIME + " the ban expires"},
755+
{RPCResult::Type::NUM_TIME, "ban_duration", "The ban duration, in seconds"},
755756
}},
756757
}},
757758
RPCExamples{
@@ -776,6 +777,7 @@ static RPCHelpMan listbanned()
776777
rec.pushKV("address", entry.first.ToString());
777778
rec.pushKV("ban_created", banEntry.nCreateTime);
778779
rec.pushKV("banned_until", banEntry.nBanUntil);
780+
rec.pushKV("ban_duration", (banEntry.nBanUntil - banEntry.nCreateTime));
779781

780782
bannedAddresses.push_back(rec);
781783
}

0 commit comments

Comments
 (0)