Merge branch 'master' of github.com:jedmccaleb/NewCoin

This commit is contained in:
Arthur Britto
2012-06-11 20:17:10 -07:00
10 changed files with 51 additions and 49 deletions

View File

@@ -156,7 +156,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="Account.h" />
<ClInclude Include="Application.h" />
<ClInclude Include="bitcoinUtil.h" />
<ClInclude Include="Conversion.h" />
<ClInclude Include="cryptopp\config.h" />

View File

@@ -248,9 +248,6 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Application.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="KnownNodeList.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@@ -76,3 +76,6 @@
[rpc_allow_remote]
1
[validation_seed]
snTBDmrhUK3znvF8AaQURLm4UCkbS

View File

@@ -364,20 +364,20 @@ void Ledger::addJson(Json::Value& ret, int options)
Json::Value ledger(Json::objectValue);
boost::recursive_mutex::scoped_lock sl(mLock);
ledger["ParentHash"] = mParentHash.GetHex();
ledger["parentHash"] = mParentHash.GetHex();
if(mClosed)
{
ledger["Hash"] = mHash.GetHex();
ledger["TransactionHash"] = mTransHash.GetHex();
ledger["AccountHash"] = mAccountHash.GetHex();
ledger["Closed"] = true;
ledger["Accepted"] = mAccepted;
ledger["TotalCoins"] = boost::lexical_cast<std::string>(mTotCoins);
ledger["hash"] = mHash.GetHex();
ledger["transactionHash"] = mTransHash.GetHex();
ledger["accountHash"] = mAccountHash.GetHex();
ledger["closed"] = true;
ledger["accepted"] = mAccepted;
ledger["totalCoins"] = boost::lexical_cast<std::string>(mTotCoins);
}
else ledger["Closed"] = false;
else ledger["closed"] = false;
if (mCloseTime != 0)
ledger["CloseTime"] = boost::posix_time::to_simple_string(ptFromSeconds(mCloseTime));
ledger["closeTime"] = boost::posix_time::to_simple_string(ptFromSeconds(mCloseTime));
bool full = (options & LEDGER_JSON_FULL) != 0;
if (full || ((options & LEDGER_JSON_DUMP_TXNS) != 0))
{
@@ -393,7 +393,7 @@ void Ledger::addJson(Json::Value& ret, int options)
}
else txns.append(item->getTag().GetHex());
}
ledger["Transactions"] = txns;
ledger["transactions"] = txns;
}
if (full || ((options & LEDGER_JSON_DUMP_STATE) != 0))
{
@@ -410,9 +410,10 @@ void Ledger::addJson(Json::Value& ret, int options)
else
state.append(item->getTag().GetHex());
}
ledger["AccountState"] = state;
ledger["accountState"] = state;
}
ret[boost::lexical_cast<std::string>(mLedgerSeq)] = ledger;
ledger["seqNum"]=boost::lexical_cast<std::string>(mLedgerSeq);
ret["ledger"] = ledger;
}
void Ledger::setAcquiring(void)

View File

@@ -1076,7 +1076,7 @@ Json::Value RPCServer::doPasswordSet(Json::Value& params)
std::vector<unsigned char> vucGeneratorCipher = naRegular0Private.accountPrivateEncrypt(naRegular0Public, naMasterGenerator.getFamilyGenerator());
std::vector<unsigned char> vucGeneratorSig;
// Prove that we have the corrisponding private key to the generator id. So, we can get the generator id.
// Prove that we have the corresponding private key to the generator id. So, we can get the generator id.
// XXX Check result.
naRegular0Private.accountPrivateSign(Serializer::getSHA512Half(vucGeneratorCipher), vucGeneratorSig);
@@ -1085,7 +1085,7 @@ Json::Value RPCServer::doPasswordSet(Json::Value& params)
unsigned int iIndex = -1; // Compensate for initial increment.
int iMax = theConfig.ACCOUNT_PROBE_MAX;
// YYY Could probe peridoically to see if accounts exists.
// YYY Could probe periodically to see if accounts exists.
// YYY Max could be set randomly.
// Don't look at ledger entries to determine if the account exists. Don't want to leak to thin server that these accounts are
// related.
@@ -1131,7 +1131,9 @@ Json::Value RPCServer::doPasswordSet(Json::Value& params)
Json::Value RPCServer::doPeers(Json::Value& params)
{
// peers
return theApp->getConnectionPool().getPeersJson();
Json::Value obj(Json::objectValue);
obj["peers"]=theApp->getConnectionPool().getPeersJson();
return obj;
}
// send regular_seed paying_account account_id amount [currency] [send_max] [send_currency]
@@ -1422,7 +1424,7 @@ Json::Value RPCServer::doAccountTransactions(Json::Value& params)
#endif
std::vector< std::pair<uint32, uint256> > txns = mNetOps->getAffectedAccounts(account, minLedger, maxLedger);
Json::Value ret(Json::objectValue);
ret["Account"] = account.humanAccountID();
ret["account"] = account.humanAccountID();
Json::Value ledgers(Json::arrayValue);
uint32 currentLedger = 0;
@@ -1433,23 +1435,23 @@ Json::Value RPCServer::doAccountTransactions(Json::Value& params)
{
if (currentLedger != 0) // add old ledger
{
ledger["Transactions"] = jtxns;
ledger["transactions"] = jtxns;
ledgers.append(ledger);
ledger = Json::objectValue;
}
currentLedger = it->first;
ledger["LedgerSeq"] = currentLedger;
ledger["ledgerSeq"] = currentLedger;
jtxns = Json::arrayValue;
}
jtxns.append(it->second.GetHex());
}
if (currentLedger != 0)
{
ledger["Transactions"] = jtxns;
ledger["transactions"] = jtxns;
ledgers.append(ledger);
}
ret["Ledgers"] = ledgers;
ret["ledgers"] = ledgers;
return ret;
#ifndef DEBUG
}

View File

@@ -57,9 +57,9 @@ std::string SerializedLedgerEntry::getText() const
Json::Value SerializedLedgerEntry::getJson(int options) const
{
Json::Value ret(mObject.getJson(options));
ret["Type"] = mFormat->t_name;
ret["Index"] = mIndex.GetHex();
ret["Version"] = mVersion.getText();
ret["type"] = mFormat->t_name;
ret["index"] = mIndex.GetHex();
ret["version"] = mVersion.getText();
return ret;
}

View File

@@ -288,14 +288,14 @@ void SerializedTransaction::makeITFieldAbsent(SOE_Field field)
Json::Value SerializedTransaction::getJson(int options) const
{
Json::Value ret = Json::objectValue;
ret["ID"] = getTransactionID().GetHex();
ret["Signature"] = mSignature.getText();
ret["id"] = getTransactionID().GetHex();
ret["signature"] = mSignature.getText();
Json::Value middle = mMiddleTxn.getJson(options);
middle["Type"] = mFormat->t_name;
ret["Middle"] = middle;
middle["type"] = mFormat->t_name;
ret["middle"] = middle;
ret["Inner"] = mInnerTxn.getJson(options);
ret["inner"] = mInnerTxn.getJson(options);
return ret;
}

View File

@@ -344,7 +344,7 @@ Json::Value STPath::getJson(int) const
Json::Value elem(Json::objectValue);
NewcoinAddress account;
account.setAccountID(it->getNode());
elem["Account"] = account.humanAccountID();
elem["account"] = account.humanAccountID();
ret.append(elem);
break;
}
@@ -352,7 +352,7 @@ Json::Value STPath::getJson(int) const
case STPathElement::typeOffer:
{
Json::Value elem(Json::objectValue);
elem["Offer"] = it->getNode().GetHex();
elem["offer"] = it->getNode().GetHex();
ret.append(elem);
break;
}

View File

@@ -638,21 +638,21 @@ Json::Value Transaction::getJson(bool decorate, bool paid, bool credited) const
{
Json::Value ret(mTransaction->getJson(0));
if (mInLedger) ret["InLedger"]=mInLedger;
if (paid) ret["Paid"]=true;
if (mInLedger) ret["inLedger"]=mInLedger;
if (paid) ret["paid"]=true;
switch(mStatus)
{
case NEW: ret["Status"] = "new"; break;
case INVALID: ret["Status"] = "invalid"; break;
case INCLUDED: ret["Status"] = "included"; break;
case CONFLICTED: ret["Status"] = "conflicted"; break;
case COMMITTED: ret["Status"] = "committed"; break;
case HELD: ret["Status"] = "held"; break;
case REMOVED: ret["Status"] = "removed"; break;
case OBSOLETE: ret["Status"] = "obsolete"; break;
case INCOMPLETE: ret["Status"] = "incomplete"; break;
default: ret["Status"] = "unknown";
case NEW: ret["status"] = "new"; break;
case INVALID: ret["status"] = "invalid"; break;
case INCLUDED: ret["status"] = "included"; break;
case CONFLICTED: ret["status"] = "conflicted"; break;
case COMMITTED: ret["status"] = "committed"; break;
case HELD: ret["status"] = "held"; break;
case REMOVED: ret["status"] = "removed"; break;
case OBSOLETE: ret["status"] = "obsolete"; break;
case INCOMPLETE: ret["status"] = "incomplete"; break;
default: ret["status"] = "unknown";
}
#if 0

View File

@@ -1234,7 +1234,7 @@ void UniqueNodeList::nodeRemove(NewcoinAddress naNodePublic)
}
}
// XXX Broken should opperate on seeds.
// XXX Broken should operate on seeds.
void UniqueNodeList::nodeReset()
{
{
@@ -1267,8 +1267,8 @@ Json::Value UniqueNodeList::getUnlJson()
Json::Value node(Json::objectValue);
node["PublicKey"] = strPublicKey;
node["Comment"] = strComment;
node["publicKey"] = strPublicKey;
node["comment"] = strComment;
ret.append(node);
}