aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-22 10:18:28 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-22 10:18:28 -0500
commit426d2ac8ee9b3be3a06b057b750826496d1c0950 (patch)
treec630135ab60ac3dff91ef514b2da4399c9fe7539 /src/cryptonote_core/tx_pool.cpp
parentMerge pull request #5980 (diff)
parenttx_pool: do not divide by 0 (diff)
downloadmonero-426d2ac8ee9b3be3a06b057b750826496d1c0950.tar.xz
Merge pull request #5981
88c9d90 protocol: initialize block_weight in block_complete_entry ctor (moneromooo-monero) fe443bb cryptonote: don't leave block_weight uninitialized (moneromooo-monero) 1ba9baf tx_pool: do not divide by 0 (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r--src/cryptonote_core/tx_pool.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index 648e691d0..0d70f2992 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -259,7 +259,7 @@ namespace cryptonote
m_blockchain.add_txpool_tx(id, blob, meta);
if (!insert_key_images(tx, id, kept_by_block))
return false;
- m_txs_by_fee_and_receive_time.emplace(std::pair<double, std::time_t>(fee / (double)tx_weight, receive_time), id);
+ m_txs_by_fee_and_receive_time.emplace(std::pair<double, std::time_t>(fee / (double)(tx_weight ? tx_weight : 1), receive_time), id);
lock.commit();
}
catch (const std::exception &e)
@@ -305,7 +305,7 @@ namespace cryptonote
m_blockchain.add_txpool_tx(id, blob, meta);
if (!insert_key_images(tx, id, kept_by_block))
return false;
- m_txs_by_fee_and_receive_time.emplace(std::pair<double, std::time_t>(fee / (double)tx_weight, receive_time), id);
+ m_txs_by_fee_and_receive_time.emplace(std::pair<double, std::time_t>(fee / (double)(tx_weight ? tx_weight : 1), receive_time), id);
lock.commit();
}
catch (const std::exception &e)