Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Catch memo encoding errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapk00 committed Apr 27, 2020
1 parent 0d49597 commit 7bcc266
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/src/lightwallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,17 @@ impl LightWallet {

for (to, value, memo) in recepients {
// Compute memo if it exists
let encoded_memo = memo.map(|s| Memo::from_str(&s).unwrap());
let encoded_memo = match memo {
None => None,
Some(s) => match Memo::from_str(&s) {
None => {
let e = format!("Error creating output. Memo {:?} is too long", s);
error!("{}", e);
return Err(e);
},
Some(m) => Some(m)
}
};

println!("{}: Adding output", now() - start_time);

Expand Down

0 comments on commit 7bcc266

Please sign in to comment.