h256root()const{assert(node(m_root).size());h256ret=(m_root==c_shaNull?h256():m_root);/*std::cout << "Returning root as " << ret << " (really " << m_root << ")" << std::endl;*/returnret;}// patch the root in the case of the empty trie. TODO: handle this properly.
@ -16,23 +16,33 @@ class OperandOutOfRange: public VMException { public: OperandOutOfRange(u256 _mi
classNotEnoughCash:publicException{};
classGasPriceTooLow:publicException{};
classBlockGasLimitReached:publicException{};
classNoSuchContract:publicException{};
classContractAddressCollision:publicException{};
classFeeTooSmall:publicException{};
classTooMuchGasUsed:publicException{};
classExtraDataTooBig:publicException{};
classInvalidSignature:publicException{};
classInvalidTransactionFormat:publicException{public:InvalidTransactionFormat(int_f,bytesConstRef_d):m_f(_f),m_d(_d.toBytes()){}intm_f;bytesm_d;virtualstd::stringdescription()const{return"Invalid transaction format: Bad field "+toString(m_f)+" ("+toHex(m_d)+")";}};
classInvalidBlockFormat:publicException{public:InvalidBlockFormat(int_f,bytesConstRef_d):m_f(_f),m_d(_d.toBytes()){}intm_f;bytesm_d;virtualstd::stringdescription()const{return"Invalid block format: Bad field "+toString(m_f)+" ("+toHex(m_d)+")";}};
classInvalidBlockHeaderFormat:publicException{public:InvalidBlockHeaderFormat(int_f,bytesConstRef_d):m_f(_f),m_d(_d.toBytes()){}intm_f;bytesm_d;virtualstd::stringdescription()const{return"Invalid block header format: Bad field "+toString(m_f)+" ("+toHex(m_d)+")";}};
// Don't like transactions whose gas price is too low. NOTE: this won't stay here forever - it's just until we get a proper gas price discovery protocol going.
TrieDB<Address,Overlay>m_state;///< Our state tree, as an Overlay DB.
Transactionsm_transactions;///< The current list of transactions that we've included in the state.
std::vector<TransactionReceipt>m_transactions;///< The current list of transactions that we've included in the state.
std::set<h256>m_transactionSet;///< The set of transaction hashes that we've included in the state.
GenericTrieDB<Overlay>m_transactionManifest;///< The transactions trie; saved from the last commitToMine, or invalid/empty if commitToMine was never called.
mutablestd::map<Address,AddressState>m_cache;///< Our address cache. This stores the states of each address that has (or at least might have) been changed.
BlockInfom_previousBlock;///< The previous block's information.
BlockInfom_currentBlock;///< The current block's information.