mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix extraneous offer creation.
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
SETUP_LOG();
|
SETUP_LOG();
|
||||||
|
|
||||||
DECLARE_INSTANCE(LedgerEntrySetEntry);
|
DECLARE_INSTANCE(LedgerEntrySetEntry);
|
||||||
DECLARE_INSTANCE(LedgerEntrySet)
|
DECLARE_INSTANCE(LedgerEntrySet)
|
||||||
|
|
||||||
@@ -1284,4 +1285,5 @@ void LedgerEntrySet::accountSend(const uint160& uSenderID, const uint160& uRecei
|
|||||||
rippleSend(uSenderID, uReceiverID, saAmount);
|
rippleSend(uSenderID, uReceiverID, saAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
|
SETUP_LOG();
|
||||||
|
|
||||||
// Take as much as possible. Adjusts account balances. Charges fees on top to taker.
|
// Take as much as possible. Adjusts account balances. Charges fees on top to taker.
|
||||||
// --> uBookBase: The order book to take against.
|
// --> uBookBase: The order book to take against.
|
||||||
// --> saTakerPays: What the taker offers (w/ issuer)
|
// --> saTakerPays: What the taker offers (w/ issuer)
|
||||||
@@ -262,7 +264,6 @@ TER OfferCreateTransactor::doApply()
|
|||||||
const uint32 uSequence = mTxn.getSequence();
|
const uint32 uSequence = mTxn.getSequence();
|
||||||
|
|
||||||
const uint256 uLedgerIndex = Ledger::getOfferIndex(mTxnAccountID, uSequence);
|
const uint256 uLedgerIndex = Ledger::getOfferIndex(mTxnAccountID, uSequence);
|
||||||
SLE::pointer sleOffer = mEngine->entryCreate(ltOFFER, uLedgerIndex);
|
|
||||||
|
|
||||||
Log(lsINFO) << "doOfferCreate: Creating offer node: " << uLedgerIndex.ToString() << " uSequence=" << uSequence;
|
Log(lsINFO) << "doOfferCreate: Creating offer node: " << uLedgerIndex.ToString() << " uSequence=" << uSequence;
|
||||||
|
|
||||||
@@ -431,6 +432,8 @@ TER OfferCreateTransactor::doApply()
|
|||||||
Log(lsWARNING) << "doOfferCreate: uPaysCurrency=" << saTakerPays.getHumanCurrency();
|
Log(lsWARNING) << "doOfferCreate: uPaysCurrency=" << saTakerPays.getHumanCurrency();
|
||||||
Log(lsWARNING) << "doOfferCreate: uGetsCurrency=" << saTakerGets.getHumanCurrency();
|
Log(lsWARNING) << "doOfferCreate: uGetsCurrency=" << saTakerGets.getHumanCurrency();
|
||||||
|
|
||||||
|
SLE::pointer sleOffer = mEngine->entryCreate(ltOFFER, uLedgerIndex);
|
||||||
|
|
||||||
sleOffer->setFieldAccount(sfAccount, mTxnAccountID);
|
sleOffer->setFieldAccount(sfAccount, mTxnAccountID);
|
||||||
sleOffer->setFieldU32(sfSequence, uSequence);
|
sleOffer->setFieldU32(sfSequence, uSequence);
|
||||||
sleOffer->setFieldH256(sfBookDirectory, uDirectory);
|
sleOffer->setFieldH256(sfBookDirectory, uDirectory);
|
||||||
@@ -444,11 +447,16 @@ TER OfferCreateTransactor::doApply()
|
|||||||
|
|
||||||
if (bPassive)
|
if (bPassive)
|
||||||
sleOffer->setFlag(lsfPassive);
|
sleOffer->setFlag(lsfPassive);
|
||||||
|
|
||||||
|
Log(lsINFO) << boost::str(boost::format("doOfferCreate: final terResult=%s sleOffer=%s")
|
||||||
|
% transToken(terResult)
|
||||||
|
% sleOffer->getJson(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(lsINFO) << "doOfferCreate: final sleOffer=" << sleOffer->getJson(0);
|
tLog(tesSUCCESS != terResult, lsINFO) << boost::str(boost::format("doOfferCreate: final terResult=%s") % transToken(terResult));
|
||||||
|
|
||||||
return terResult;
|
return terResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
SETUP_LOG();
|
SETUP_LOG();
|
||||||
|
|
||||||
DECLARE_INSTANCE(TransactionEngine);
|
DECLARE_INSTANCE(TransactionEngine);
|
||||||
|
|
||||||
void TransactionEngine::txnWrite()
|
void TransactionEngine::txnWrite()
|
||||||
|
|||||||
@@ -91,4 +91,5 @@ std::string transHuman(TER terCode)
|
|||||||
|
|
||||||
return transResultInfo(terCode, strToken, strHuman) ? strHuman : "-";
|
return transResultInfo(terCode, strToken, strHuman) ? strHuman : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ buster.testCase("Offer tests", {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
"//=>ripple currency conversion : offerer into debt" :
|
"ripple currency conversion : offerer into debt" :
|
||||||
// alice in, carol out
|
// alice in, carol out
|
||||||
function (done) {
|
function (done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user