From 85dc0ce3a517ae092846f64710416d2743a8e29e Mon Sep 17 00:00:00 2001
From: moneromooo-monero <moneromooo-monero@users.noreply.github.com>
Date: Thu, 1 Sep 2016 09:04:45 +0100
Subject: [PATCH] wallet: sanity check on histogram response

---
 src/wallet/wallet2.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index d889720af..a4d1ab8ec 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2709,6 +2709,8 @@ void wallet2::get_outs(std::vector<std::vector<entry>> &outs, const std::list<tr
         }
       }
       LOG_PRINT_L1("" << num_outs << " outputs of size " << print_money(amount));
+      THROW_WALLET_EXCEPTION_IF(num_outs == 0, error::wallet_internal_error,
+          "histogram reports no outputs for " + boost::lexical_cast<std::string>(amount) + ", not even ours");
 
       if (num_outs <= requested_outputs_count)
       {