@@ -753,6 +753,7 @@ static RPCHelpMan listbanned()
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" },
755755 {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" },
756757 }},
757758 }},
758759 RPCExamples{
@@ -768,6 +769,7 @@ static RPCHelpMan listbanned()
768769
769770 banmap_t banMap;
770771 node.banman ->GetBanned (banMap);
772+ const int64_t current_time{GetTime ()};
771773
772774 UniValue bannedAddresses (UniValue::VARR);
773775 for (const auto & entry : banMap)
@@ -778,6 +780,7 @@ static RPCHelpMan listbanned()
778780 rec.pushKV (" ban_created" , banEntry.nCreateTime );
779781 rec.pushKV (" banned_until" , banEntry.nBanUntil );
780782 rec.pushKV (" ban_duration" , (banEntry.nBanUntil - banEntry.nCreateTime ));
783+ rec.pushKV (" time_remaining" , (banEntry.nBanUntil - current_time));
781784
782785 bannedAddresses.push_back (rec);
783786 }
0 commit comments