aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-16 14:22:10 +0100
committerRiccardo Spagni <ric@spagni.net>2018-02-16 14:22:10 +0100
commitbfddb2283b711b951c1f971e77a34d73f28a729b (patch)
tree42d657f7c0337ab9d33c2ae37dd787a818bb1384 /src
parentMerge pull request #3207 (diff)
parenttxpool: Properly bail out when outputs_amount == inputs_amount (diff)
downloadmonero-bfddb2283b711b951c1f971e77a34d73f28a729b.tar.xz
Merge pull request #3210
39992134 txpool: Properly bail out when outputs_amount == inputs_amount (Leon Klingele)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/tx_pool.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index d7d1c25a5..5f54e93f1 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -151,13 +151,20 @@ namespace cryptonote
}
uint64_t outputs_amount = get_outs_money_amount(tx);
- if(outputs_amount >= inputs_amount)
+ if(outputs_amount > inputs_amount)
{
LOG_PRINT_L1("transaction use more money then it has: use " << print_money(outputs_amount) << ", have " << print_money(inputs_amount));
tvc.m_verifivation_failed = true;
tvc.m_overspend = true;
return false;
}
+ else if(outputs_amount == inputs_amount)
+ {
+ LOG_PRINT_L1("transaction fee is zero: outputs_amount == inputs_amount, rejecting.");
+ tvc.m_verifivation_failed = true;
+ tvc.m_fee_too_low = true;
+ return false;
+ }
fee = inputs_amount - outputs_amount;
}