Browse Source

Better diagnostics.

Mining bug fix.
cl-refactor
Gav Wood 11 years ago
parent
commit
c09fd11a2c
  1. 6
      libethereum/BlockChain.cpp
  2. 5
      libethereum/BlockChain.h
  3. 1
      libethereum/Client.cpp

6
libethereum/BlockChain.cpp

@ -124,15 +124,15 @@ void BlockChain::import(bytes const& _block, Overlay const& _db)
auto newHash = eth::sha3(_block);
clog(BlockChainChat) << "Attempting import of " << newHash << "...";
// Check block doesn't already exist first!
if (details(newHash))
{
clog(BlockChainNote) << " Not new.";
clog(BlockChainChat) << " Not new.";
throw AlreadyHaveBlock();
}
clog(BlockChainNote) << "Attempting import of " << newHash << "...";
// Work out its number as the parent's number + 1
auto pd = details(bi.parentHash);
if (!pd)

5
libethereum/BlockChain.h

@ -55,8 +55,9 @@ class Overlay;
class AlreadyHaveBlock: public std::exception {};
class UnknownParent: public std::exception {};
struct BlockChainNote: public LogChannel { static const char constexpr* name = "-B-"; };
struct BlockChainWarn: public LogChannel { static const char constexpr* name = "!B!"; };
struct BlockChainChat: public LogChannel { static const char constexpr* name = "-B-"; static const int verbosity = 7; };
struct BlockChainNote: public LogChannel { static const char constexpr* name = "=B="; static const int verbosity = 1; };
struct BlockChainWarn: public LogChannel { static const char constexpr* name = "!B!"; static const int verbosity = 0; };
/**
* @brief Implements the blockchain database. All data this gives is disk-backed.

1
libethereum/Client.cpp

@ -169,6 +169,7 @@ void Client::work()
m_mineProgress.best = 0;
m_lock.unlock();
m_changed = true;
m_miningStarted = false; // need to re-commit to mine.
}
}
else

Loading…
Cancel
Save