From 0fd810777aa744b44274fbfc4a93b4362923c218 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Tue, 24 Oct 2023 12:22:03 +0800 Subject: [PATCH] Fix token check bugs from #2582 (#2612) * Fix token check bugs from #2582 * fix fmt --- src/dfi/consensus/tokens.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dfi/consensus/tokens.cpp b/src/dfi/consensus/tokens.cpp index b6897be0ddc..4734b99b135 100644 --- a/src/dfi/consensus/tokens.cpp +++ b/src/dfi/consensus/tokens.cpp @@ -11,9 +11,8 @@ Res CTokensConsensus::CheckTokenCreationTx() const { if (tx.vout.size() < 2 || tx.vout[0].nValue < GetTokenCreationFee(height) || tx.vout[0].nTokenId != DCT_ID{0} || - tx.vout[1].nValue != GetTokenCollateralAmount() || tx.vout[1].nTokenId != DCT_ID{0}, - "malformed tx vouts (wrong creation fee or collateral amount)") { - ; + tx.vout[1].nValue != GetTokenCollateralAmount() || tx.vout[1].nTokenId != DCT_ID{0}) { + return Res::Err("malformed tx vouts (wrong creation fee or collateral amount)"); } return Res::Ok();