Fix cli wallet memo displaying

This commit is contained in:
serkixenos 2021-12-27 00:28:29 -04:00 committed by Nathaniel
parent ee0d2b21e0
commit dcdf406a2d
No known key found for this signature in database
GPG key ID: B4344309A110851E

View file

@ -4192,6 +4192,8 @@ string operation_printer::operator()(const transfer_operation& op) const
std::string memo; std::string memo;
if( op.memo ) if( op.memo )
{ {
bool is_encrypted = ((op.memo->from != public_key_type()) && (op.memo->to != public_key_type()));
if (is_encrypted) {
if( wallet.is_locked() ) if( wallet.is_locked() )
{ {
out << " -- Unlock wallet to see memo."; out << " -- Unlock wallet to see memo.";
@ -4214,6 +4216,10 @@ string operation_printer::operator()(const transfer_operation& op) const
elog("Error when decrypting memo: ${e}", ("e", e.to_detail_string())); elog("Error when decrypting memo: ${e}", ("e", e.to_detail_string()));
} }
} }
} else {
memo = op.memo->get_message(private_key_type(), public_key_type());
out << " -- Memo: " << memo;
}
} }
fee(op.fee); fee(op.fee);
return memo; return memo;