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); m_s.noteSending(sender);
// Pay... // 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); m_s.subBalance(sender, cost);
if (m_t.isCreation()) 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) 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); m_s.addBalance(_receiveAddress, _value);
if (m_s.isContractAddress(_receiveAddress)) if (m_s.isContractAddress(_receiveAddress))
@ -748,7 +748,7 @@ u256 Executive::gas() const
void Executive::finalize() 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); m_s.addBalance(m_ext->origin, m_endGas * m_ext->gasPrice);
u256 gasSpent = (m_startGas - 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)."; cnote << "Transferring" << (100.0 - 100.0 / c_feesKept) << "% of" << formatBalance(gasSpent) << "=" << formatBalance(feesEarned) << "to miner (" << formatBalance(gasSpent - feesEarned) << "is burnt).";
*/ */
u256 feesEarned = gasSpent; u256 feesEarned = gasSpent;
cnote << "Transferring" << formatBalance(gasSpent) << "to miner."; // cnote << "Transferring" << formatBalance(gasSpent) << "to miner.";
m_s.addBalance(m_s.m_currentBlock.coinbaseAddress, feesEarned); 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) if (!_originAddress)
_originAddress = _senderAddress; _originAddress = _senderAddress;
cnote << "Transferring" << formatBalance(_value) << "to receiver."; // cnote << "Transferring" << formatBalance(_value) << "to receiver.";
addBalance(_receiveAddress, _value); addBalance(_receiveAddress, _value);
if (isContractAddress(_receiveAddress)) if (isContractAddress(_receiveAddress))

37
neth/main.cpp

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

Loading…
Cancel
Save