Fix empty lines in `print_locked_stakes` output

Fixes #1575

We were appending a newline for every locked stake rather than just this
wallet's locked stakes.
This commit is contained in:
Jason Rhinelander 2022-07-11 14:38:56 -03:00
parent 7145cdae6e
commit efebe83225
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 5 additions and 5 deletions

View File

@ -6356,11 +6356,6 @@ bool simple_wallet::query_locked_stakes(bool print_result)
crypto::key_image key_image;
for (const auto& entry : response)
{
if (first)
first = false;
else
msg_buf += "\n";
if (!tools::hex_to_type(entry.key_image, key_image))
{
fail_msg_writer() << tr("Failed to parse hex representation of key image: ") << entry.key_image;
@ -6370,6 +6365,11 @@ bool simple_wallet::query_locked_stakes(bool print_result)
if (!m_wallet->contains_key_image(key_image))
continue;
if (first)
first = false;
else
msg_buf += "\n";
has_locked_stakes = true;
if (!print_result)
continue;