@@ -753,6 +753,7 @@ static RPCHelpMan listbanned()
753
753
{RPCResult::Type::NUM_TIME, " ban_created" , " The " + UNIX_EPOCH_TIME + " the ban was created" },
754
754
{RPCResult::Type::NUM_TIME, " banned_until" , " The " + UNIX_EPOCH_TIME + " the ban expires" },
755
755
{RPCResult::Type::NUM_TIME, " ban_duration" , " The ban duration, in seconds" },
756
+ {RPCResult::Type::NUM_TIME, " time_remaining" , " The time remaining until the ban expires, in seconds" },
756
757
}},
757
758
}},
758
759
RPCExamples{
@@ -768,6 +769,7 @@ static RPCHelpMan listbanned()
768
769
769
770
banmap_t banMap;
770
771
node.banman ->GetBanned (banMap);
772
+ const int64_t current_time{GetTime ()};
771
773
772
774
UniValue bannedAddresses (UniValue::VARR);
773
775
for (const auto & entry : banMap)
@@ -778,6 +780,7 @@ static RPCHelpMan listbanned()
778
780
rec.pushKV (" ban_created" , banEntry.nCreateTime );
779
781
rec.pushKV (" banned_until" , banEntry.nBanUntil );
780
782
rec.pushKV (" ban_duration" , (banEntry.nBanUntil - banEntry.nCreateTime ));
783
+ rec.pushKV (" time_remaining" , (banEntry.nBanUntil - current_time));
781
784
782
785
bannedAddresses.push_back (rec);
783
786
}
0 commit comments