0
0
Fork 0
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:
Jarol Rodriguez 2021-04-06 23:01:10 -04:00
parent c95c61657a
commit 5456b34531

View file

@ -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);
}