Browse Source

Quieter logging.

Rename neth client.
cl-refactor
Gav Wood 11 years ago
parent
commit
fb62d83321
  1. 10
      libethereum/State.cpp
  2. 37
      neth/main.cpp

10
libethereum/State.cpp

@ -658,7 +658,7 @@ void Executive::setup(bytesConstRef _rlp)
m_s.noteSending(sender);
// Pay...
cnote << "Paying" << formatBalance(cost) << "from sender (includes" << m_t.gas << "gas at" << formatBalance(m_t.gasPrice) << ")";
// cnote << "Paying" << formatBalance(cost) << "from sender (includes" << m_t.gas << "gas at" << formatBalance(m_t.gasPrice) << ")";
m_s.subBalance(sender, cost);
if (m_t.isCreation())
@ -669,7 +669,7 @@ void Executive::setup(bytesConstRef _rlp)
void Executive::call(Address _receiveAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256 _gas, Address _originAddress)
{
cnote << "Transferring" << formatBalance(_value) << "to receiver.";
// cnote << "Transferring" << formatBalance(_value) << "to receiver.";
m_s.addBalance(_receiveAddress, _value);
if (m_s.isContractAddress(_receiveAddress))
@ -748,7 +748,7 @@ u256 Executive::gas() const
void Executive::finalize()
{
cnote << "Refunding" << formatBalance(m_endGas * m_ext->gasPrice) << "to origin (=" << m_endGas << "*" << formatBalance(m_ext->gasPrice) << ")";
// cnote << "Refunding" << formatBalance(m_endGas * m_ext->gasPrice) << "to origin (=" << m_endGas << "*" << formatBalance(m_ext->gasPrice) << ")";
m_s.addBalance(m_ext->origin, m_endGas * m_ext->gasPrice);
u256 gasSpent = (m_startGas - m_endGas) * m_ext->gasPrice;
@ -757,7 +757,7 @@ void Executive::finalize()
cnote << "Transferring" << (100.0 - 100.0 / c_feesKept) << "% of" << formatBalance(gasSpent) << "=" << formatBalance(feesEarned) << "to miner (" << formatBalance(gasSpent - feesEarned) << "is burnt).";
*/
u256 feesEarned = gasSpent;
cnote << "Transferring" << formatBalance(gasSpent) << "to miner.";
// cnote << "Transferring" << formatBalance(gasSpent) << "to miner.";
m_s.addBalance(m_s.m_currentBlock.coinbaseAddress, feesEarned);
}
@ -842,7 +842,7 @@ bool State::call(Address _receiveAddress, Address _senderAddress, u256 _value, u
if (!_originAddress)
_originAddress = _senderAddress;
cnote << "Transferring" << formatBalance(_value) << "to receiver.";
// cnote << "Transferring" << formatBalance(_value) << "to receiver.";
addBalance(_receiveAddress, _value);
if (isContractAddress(_receiveAddress))

37
neth/main.cpp

@ -98,35 +98,32 @@ void interactiveHelp()
<< " exit Exits the application." << endl;
}
string credits(bool _interactive = false)
string credits()
{
std::ostringstream ccout;
ccout
<< "Ethereum (++) " << ETH_QUOTED(ETH_VERSION) << endl
<< " Code by Gav Wood, (c) 2013, 2014." << endl
<< "NEthereum (++) " << ETH_QUOTED(ETH_VERSION) << endl
<< " Code by Gav Wood & , (c) 2013, 2014." << endl
<< " Based on a design by Vitalik Buterin." << endl << endl;
if (_interactive)
{
string vs = toString(ETH_QUOTED(ETH_VERSION));
vs = vs.substr(vs.find_first_of('.') + 1)[0];
int pocnumber = stoi(vs);
string m_servers;
if (pocnumber == 4)
m_servers = "54.72.31.55";
else
m_servers = "54.201.28.117";
string vs = toString(ETH_QUOTED(ETH_VERSION));
vs = vs.substr(vs.find_first_of('.') + 1)[0];
int pocnumber = stoi(vs);
string m_servers;
if (pocnumber == 4)
m_servers = "54.72.31.55";
else
m_servers = "54.201.28.117";
ccout << "Type 'netstart 30303' to start networking" << endl;
ccout << "Type 'connect " << m_servers << " 30303' to connect" << endl;
ccout << "Type 'exit' to quit" << endl << endl;
}
ccout << "Type 'netstart 30303' to start networking" << endl;
ccout << "Type 'connect " << m_servers << " 30303' to connect" << endl;
ccout << "Type 'exit' to quit" << endl << endl;
return ccout.str();
}
void version()
{
cout << "eth version " << ETH_QUOTED(ETH_VERSION) << endl;
cout << "neth version " << ETH_QUOTED(ETH_VERSION) << endl;
cout << "Build: " << ETH_QUOTED(ETH_BUILD_PLATFORM) << "/" << ETH_QUOTED(ETH_BUILD_TYPE) << endl;
exit(0);
}
@ -374,7 +371,7 @@ int main(int argc, char** argv)
if (!clientName.empty())
clientName += "/";
Client c("Ethereum(++)/" + clientName + "v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath);
Client c("NEthereum(++)/" + clientName + "v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath);
cout << credits();
std::ostringstream ccout;
@ -449,7 +446,7 @@ int main(int argc, char** argv)
wclrtobot(addswin);
wclrtobot(contractswin);
ccout << credits(true);
ccout << credits();
// Prompt
wmove(mainwin, 1, 4);

Loading…
Cancel
Save