Browse Source

Merge pull request #252 from caktux/develop

neth: fix pending
cl-refactor
Gav Wood 11 years ago
parent
commit
66d06105be
  1. 28
      neth/main.cpp

28
neth/main.cpp

@ -889,23 +889,21 @@ int main(int argc, char** argv)
// Pending
y = 1;
auto aps = c.pending();
for (auto const& t: aps)
for (Transaction const& t: c.pending())
{
if (t.receiveAddress)
auto s = boost::format("%1% %2%> %3%: %4% [%5%]") %
auto s = t.receiveAddress ?
boost::format("%1% %2%> %3%: %4% [%5%]") %
toString(t.safeSender()) %
(st.addressHasCode(t.receiveAddress) ? '*' : '-') %
toString(t.receiveAddress) %
toString(formatBalance(t.value)) %
toString((unsigned)t.nonce);
else
auto s = boost::format("%1% +> %2%: %3% [%4%]") %
toString((unsigned)t.nonce) :
boost::format("%1% +> %2%: %3% [%4%]") %
toString(t.safeSender()) %
toString(right160(sha3(rlpList(t.safeSender(), t.nonce)))) %
toString(formatBalance(t.value)) %
toString((unsigned)t.nonce);
mvwaddnstr(pendingwin, y++, x, s.c_str(), qwidth);
mvwaddnstr(pendingwin, y++, x, s.str().c_str(), qwidth);
if (y > height * 1 / 5 - 4)
break;
}
@ -948,14 +946,14 @@ int main(int argc, char** argv)
// Peers
y = 1;
string psc;
string pss;
auto cp = c.peers();
psc = toString(cp.size()) + " peer(s)";
for (PeerInfo const& i: cp)
for (PeerInfo const& i: c.peers())
{
pss = toString(chrono::duration_cast<chrono::milliseconds>(i.lastPing).count()) + " ms - " + i.host + ":" + toString(i.port) + " - " + i.clientVersion;
mvwaddnstr(peerswin, y++, x, pss.c_str(), qwidth);
auto s = boost::format("%1% ms - %2%:%3% - %4%") %
toString(chrono::duration_cast<chrono::milliseconds>(i.lastPing).count()) %
i.host %
toString(i.port) %
i.clientVersion;
mvwaddnstr(peerswin, y++, x, s.str().c_str(), qwidth);
if (y > height * 2 / 5 - 4)
break;
}

Loading…
Cancel
Save