aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-10-15 18:59:45 +0200
committerRiccardo Spagni <ric@spagni.net>2017-10-15 18:59:45 +0200
commitb293ad9a1a86cf0281cc2b1e0c767f76d444ba53 (patch)
treef41a5425b00a58d66f7887465876c2034d3ed472 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #2638 (diff)
parentdb_lmdb: include chain height when failing to find an output key (diff)
downloadmonero-b293ad9a1a86cf0281cc2b1e0c767f76d444ba53.tar.xz
Merge pull request #2640
22b51e06 db_lmdb: include chain height when failing to find an output key (moneromooo-monero) 5db433b3 blockchain: avoid exceptions in output verification (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 3028866c4..d91589765 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -188,7 +188,12 @@ bool Blockchain::scan_outputkeys_for_indexes(size_t tx_version, const txin_to_ke
{
try
{
- m_db->get_output_key(tx_in_to_key.amount, absolute_offsets, outputs);
+ m_db->get_output_key(tx_in_to_key.amount, absolute_offsets, outputs, true);
+ if (absolute_offsets.size() != outputs.size())
+ {
+ MERROR_VER("Output does not exist! amount = " << tx_in_to_key.amount);
+ return false;
+ }
}
catch (...)
{
@@ -208,7 +213,12 @@ bool Blockchain::scan_outputkeys_for_indexes(size_t tx_version, const txin_to_ke
add_offsets.push_back(absolute_offsets[i]);
try
{
- m_db->get_output_key(tx_in_to_key.amount, add_offsets, add_outputs);
+ m_db->get_output_key(tx_in_to_key.amount, add_offsets, add_outputs, true);
+ if (add_offsets.size() != add_outputs.size())
+ {
+ MERROR_VER("Output does not exist! amount = " << tx_in_to_key.amount);
+ return false;
+ }
}
catch (...)
{