From 38dc97b54cfea94c45300e2681bfcfaa2e02743a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 17 Mar 2015 10:26:44 +0100 Subject: [PATCH] Make value in AZ transact default to something sensible. --- alethzero/Transact.cpp | 2 ++ libethereum/BlockChain.cpp | 2 -- libethereum/EthereumPeer.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index 640ffe3d8..9e4b2812b 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -237,6 +237,8 @@ void Transact::rejigData() if (!ui->gas->isEnabled()) ui->gas->setValue(m_backupGas); ui->gas->setEnabled(true); + if (ui->gas->value() == ui->gas->minimum()) + ui->gas->setValue((int)(m_ethereum->postState().gasLimitRemaining() / 10)); } else { diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 00ede9054..54167f2ad 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -431,9 +431,7 @@ h256s BlockChain::treeRoute(h256 _from, h256 _to, h256* o_common, bool _pre, boo { // cdebug << "treeRoute" << _from.abridged() << "..." << _to.abridged(); if (!_from || !_to) - { return h256s(); - } h256s ret; h256s back; unsigned fn = details(_from).number; diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index 58cc5ca72..a6211505f 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -505,6 +505,10 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) return false; } } + catch (Exception const& _e) + { + clogS(NetWarn) << "Peer causing an Exception:" << _e.what() << _r; + } catch (std::exception const& _e) { clogS(NetWarn) << "Peer causing an exception:" << _e.what() << _r;