mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
rpc: add ban_duration field to listbanned
This commit is contained in:
parent
c95c61657a
commit
5456b34531
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue