From 199c643e8025d562dbc76840684ebe718553f037 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 15 Jul 2020 12:24:57 -0700 Subject: [PATCH] Bug fix --- src/cryptonote_core/cryptonote_format_utils.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index ca94aa3..88428d5 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -296,14 +296,20 @@ namespace cryptonote { if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_XHV && tx.vin[0].type() == typeid(txin_offshore)) { CHECKED_GET_SPECIFIC_VARIANT(in, const txin_offshore, tokey_in, false); + if(money > tokey_in.amount + money) + return false; + money += tokey_in.amount; } else if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_XHV && tx.vin[0].type() == typeid(txin_onshore)) { CHECKED_GET_SPECIFIC_VARIANT(in, const txin_onshore, tokey_in, false); + if(money > tokey_in.amount + money) + return false; + money += tokey_in.amount; } else { CHECKED_GET_SPECIFIC_VARIANT(in, const txin_to_key, tokey_in, false); + if(money > tokey_in.amount + money) + return false; + money += tokey_in.amount; } - if(money > tokey_in.amount + money) - return false; - money += tokey_in.amount; } return true; }