diff --git a/src/electrum/server.rs b/src/electrum/server.rs index 1b44ee99..ae427cd2 100644 --- a/src/electrum/server.rs +++ b/src/electrum/server.rs @@ -636,7 +636,10 @@ fn get_history( ) -> Result)>> { // to avoid silently trunacting history entries, ask for one extra more than the limit and fail if it exists let history_txids = query.history_txids(scripthash, txs_limit + 1); - ensure!(history_txids.len() <= txs_limit, ErrorKind::TooPopular); + ensure!( + history_txids.len() <= txs_limit, + ErrorKind::TooManyTxs(txs_limit) + ); Ok(history_txids) } diff --git a/src/errors.rs b/src/errors.rs index cec50cce..48274fbb 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -14,9 +14,14 @@ error_chain! { display("Iterrupted by signal {}", sig) } - TooPopular { - description("Too many history entries") - display("Too many history entries") + TooManyUtxos(limit: usize) { + description("Too many unspent transaction outputs. Contact support to raise limits.") + display("Too many unspent transaction outputs (>{}). Contact support to raise limits.", limit) + } + + TooManyTxs(limit: usize) { + description("Too many history transactions. Contact support to raise limits.") + display("Too many history transactions (>{}). Contact support to raise limits.", limit) } #[cfg(feature = "electrum-discovery")] diff --git a/src/new_index/schema.rs b/src/new_index/schema.rs index 77564200..1446d682 100644 --- a/src/new_index/schema.rs +++ b/src/new_index/schema.rs @@ -671,7 +671,7 @@ impl ChainQuery { // abort if the utxo set size excedees the limit at any point in time if utxos.len() > limit { - bail!(ErrorKind::TooPopular) + bail!(ErrorKind::TooManyUtxos(limit)) } }