Merge branch 'bug/cli-wallet-memo-display' into 'develop'

Fix cli wallet memo displaying

See merge request PBSA/peerplays!52
This commit is contained in:
serkixenos 2022-01-17 18:25:33 +00:00
commit b5a9a0101a

View file

@ -4184,6 +4184,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.";
@ -4206,6 +4208,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;