mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -158,7 +158,13 @@ STAmount::STAmount(SField::ref n, const Json::Value& v)
|
||||
|
||||
mIsNative = !currency.isString() || currency.asString().empty() || (currency.asString() == SYSTEM_CURRENCY_CODE);
|
||||
|
||||
if (!mIsNative) {
|
||||
if (mIsNative)
|
||||
{
|
||||
if (v.isObject())
|
||||
throw std::runtime_error("XRP may not be specified as an object");
|
||||
}
|
||||
else
|
||||
{ // non-XRP
|
||||
if (!currencyFromString(mCurrency, currency.asString()))
|
||||
throw std::runtime_error("invalid currency");
|
||||
|
||||
|
||||
@@ -582,7 +582,7 @@ bool SHAMap::addGiveItem(SHAMapItem::ref item, bool isTransaction, bool hasMeta)
|
||||
stack.pop();
|
||||
|
||||
if (node->isLeaf() && (node->peekItem()->getTag() == tag))
|
||||
throw std::runtime_error("addGiveItem ends on leaf with same tag");
|
||||
return false;
|
||||
|
||||
uint256 prevHash;
|
||||
returnNode(node, true);
|
||||
|
||||
@@ -7,5 +7,10 @@
|
||||
|
||||
bool TransactionEngine::checkInvariants(TER result, const SerializedTransaction& txn, TransactionEngineParams params)
|
||||
{
|
||||
|
||||
// 1) Make sure transaction changed account sequence number to correct value
|
||||
|
||||
// 2) Make sure transaction didn't create XRP
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -176,12 +176,20 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
|
||||
if (isSetBit(params, tapOPEN_LEDGER))
|
||||
{
|
||||
if (!mLedger->addTransaction(txID, s))
|
||||
{
|
||||
cLog(lsFATAL) << "Tried to add transaction to open ledger that already had it";
|
||||
assert(false);
|
||||
throw std::runtime_error("Duplicate transaction applied");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mLedger->addTransaction(txID, s, m))
|
||||
assert(false);
|
||||
{
|
||||
cLog(lsFATAL) << "Tried to add transaction to ledger that already had it";
|
||||
assert(false);
|
||||
throw std::runtime_error("Duplicate transaction applied to closed ledger");
|
||||
}
|
||||
|
||||
// Charge whatever fee they specified.
|
||||
STAmount saPaid = txn.getTransactionFee();
|
||||
|
||||
@@ -142,7 +142,8 @@ TER Transactor::checkSeq()
|
||||
cLog(lsWARNING) << "applyTransaction: past sequence number";
|
||||
|
||||
return tefPAST_SEQ;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
mTxnAccount->setFieldU32(sfSequence, t_seq + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user