Page MenuHomePhabricator

[Cashtab] [Chronik] Upgrade private message decryption error handling
ClosedPublic

Authored by emack on Oct 15 2022, 14:06.

Details

Summary

As per T2718, I played around with a few different error handling approaches but found the best solution is to simply ensure the output hex is in relation to an incoming msg before attempting to decrypt.

I have seen this error trigger on occasions when you send a few outgoing private message transactions. This is because it is attempting to decrypt the private message when it's sitting in the sender's tx history, but obviously the message has been encrypted with the recipient's pubkey (not the sender's) hence resulting in these errors.

Test Plan
  • receive encrypted message, verify no decryption errors in console and the message is successfully decrypted and rendered correctly
  • send encrypted message, verify no decryption errors in console and the message is successfully decrypted in the recipient wallet and rendered correctly
  • ensure no regression with sending/receiving unencrypted message
  • ensure no regression with sending/receiving oneToMany unencrypted message

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable