diff --git a/src/LedgerFormats.cpp b/src/LedgerFormats.cpp index dc9c75943b..919d73ea58 100644 --- a/src/LedgerFormats.cpp +++ b/src/LedgerFormats.cpp @@ -12,7 +12,7 @@ LedgerEntryFormat LedgerFormats[]= { S_FIELD(Balance), STI_UINT64, SOE_REQUIRED, 0 }, { S_FIELD(LastReceive), STI_UINT32, SOE_REQUIRED, 0 }, { S_FIELD(LastTxn), STI_UINT32, SOE_REQUIRED, 0 }, - { S_FIELD(AuthorizedKey),STI_VL, SOE_IFFLAG, 1 }, + { S_FIELD(AuthorizedKey),STI_HASH160, SOE_IFFLAG, 1 }, { S_FIELD(EmailHash), STI_HASH128, SOE_IFFLAG, 2 }, { S_FIELD(WalletLocator),STI_HASH256, SOE_IFFLAG, 4 }, { S_FIELD(MessageKey), STI_VL, SOE_IFFLAG, 8 }, @@ -21,7 +21,7 @@ LedgerEntryFormat LedgerFormats[]= }, { "GeneratorMap", ltGENERATOR_MAP, { { S_FIELD(Flags), STI_UINT32, SOE_FLAGS, 0 }, - { S_FIELD(GeneratorID), STI_ACCOUNT, SOE_REQUIRED, 0 }, + { S_FIELD(GeneratorID), STI_HASH160, SOE_REQUIRED, 0 }, { S_FIELD(Generator), STI_VL, SOE_REQUIRED, 0 }, { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x01000000 }, { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } diff --git a/src/LedgerNode.cpp b/src/LedgerNode.cpp index 29b659649a..67216fc1db 100644 --- a/src/LedgerNode.cpp +++ b/src/LedgerNode.cpp @@ -33,7 +33,7 @@ LedgerStateParms Ledger::writeBack(LedgerStateParms parms, SerializedLedgerEntry return lepCREATED; } - if(!mAccountStateMap->updateGiveItem(item, false)) + if (!mAccountStateMap->updateGiveItem(item, false)) { assert(false); return lepERROR; diff --git a/src/SHAMap.cpp b/src/SHAMap.cpp index 1779d5f326..ad7f42be47 100644 --- a/src/SHAMap.cpp +++ b/src/SHAMap.cpp @@ -520,12 +520,12 @@ bool SHAMap::updateGiveItem(SHAMapItem::pointer item, bool isTransaction) boost::recursive_mutex::scoped_lock sl(mLock); std::stack stack = getStack(tag, true); - if(stack.empty()) throw SHAMapException(MissingNode); + if (stack.empty()) throw SHAMapException(MissingNode); SHAMapTreeNode::pointer node=stack.top(); stack.pop(); - if (!node->isLeaf() || (node->peekItem()->getTag() == tag) ) + if (!node->isLeaf() || (node->peekItem()->getTag() != tag) ) { assert(false); return false; diff --git a/src/TransactionEngine.cpp b/src/TransactionEngine.cpp index 0900987df8..aba6aa276b 100644 --- a/src/TransactionEngine.cpp +++ b/src/TransactionEngine.cpp @@ -189,7 +189,7 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran if (result == terSUCCESS) { // Write back the account states and add the transaction to the ledger // WRITEME: Special case code for changing transaction key - for(std::vector::iterator it=accounts.begin(), end=accounts.end(); + for (std::vector::iterator it=accounts.begin(), end=accounts.end(); it != end; ++it) { if (it->first == taaCREATE) { @@ -198,12 +198,12 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran } else if (it->first==taaMODIFY) { - if(mLedger->writeBack(lepNONE, it->second) & lepERROR) + if (mLedger->writeBack(lepNONE, it->second) & lepERROR) assert(false); } else if (it->first == taaDELETE) { - if(!mLedger->peekAccountStateMap()->delItem(it->second->getIndex())) + if (!mLedger->peekAccountStateMap()->delItem(it->second->getIndex())) assert(false); } } diff --git a/src/main.cpp b/src/main.cpp index 2497515764..153f539a3d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include +#include #include #include @@ -108,20 +109,22 @@ int main(int argc, char* argv[]) } else if (vm.count("test")) { - std::vector vCmd; - int iCmd = vm.count("parameters"); + int iCmd = vm.count("parameters"); + std::vector pvCmd; + + pvCmd.push_back(argv[0]); if (iCmd) + { + std::vector vCmd; + vCmd = vm["parameters"].as >(); - std::vector pvCmd; + BOOST_FOREACH(std::string& param, vCmd) + pvCmd.push_back(const_cast(param.c_str())); + } - pvCmd.resize(iCmd); - - for (int i=0; i != iCmd; ++i) - pvCmd[i] = (char*) (vCmd[0].c_str()); - - iResult = unit_test_main(init_unit_test, iCmd, &pvCmd.front()); + iResult = unit_test_main(init_unit_test, iCmd, &pvCmd[0]); } else if (!vm.count("parameters")) {