From 7f91fce56861647506bbf6858a365855627bdcc8 Mon Sep 17 00:00:00 2001 From: Peter Shugalev Date: Wed, 18 Oct 2023 20:59:46 +0200 Subject: [PATCH] Catch exception thrown from CheckLelantusJMintTransaction --- src/lelantus.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lelantus.cpp b/src/lelantus.cpp index a4204186cf..3fafa8b722 100644 --- a/src/lelantus.cpp +++ b/src/lelantus.cpp @@ -441,8 +441,13 @@ bool CheckLelantusJoinSplitTransaction( for (const CTxOut &txout : tx.vout) { if (!txout.scriptPubKey.empty() && txout.scriptPubKey.IsLelantusJMint()) { - if (!CheckLelantusJMintTransaction(txout, state, hashTx, fStatefulSigmaCheck, Cout, lelantusTxInfo)) - return false; + try { + if (!CheckLelantusJMintTransaction(txout, state, hashTx, fStatefulSigmaCheck, Cout, lelantusTxInfo)) + return false; + } + catch (const std::exception &x) { + return state.Error(x.what()); + } } else if(txout.scriptPubKey.IsLelantusMint()) { return false; //putting regular mints at JoinSplit transactions is not allowed } else {