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:
@@ -304,7 +304,7 @@ void ConnectionPool::connectTo(const std::string& strIp, int iPort)
|
||||
Peer::pointer ConnectionPool::peerConnect(const std::string& strIp, int iPort)
|
||||
{
|
||||
ipPort pipPeer = make_pair(strIp, iPort);
|
||||
Peer::pointer ppResult = Peer::pointer();
|
||||
Peer::pointer ppResult;
|
||||
|
||||
boost::unordered_map<ipPort, Peer::pointer>::iterator it;
|
||||
|
||||
@@ -545,7 +545,7 @@ void ConnectionPool::peerClosed(Peer::ref peer, const std::string& strIp, int iP
|
||||
{
|
||||
//cLog(lsINFO) << "Pool: Scan: scan fail: " << strIp << " " << iPort;
|
||||
|
||||
mScanning = Peer::pointer(); // No longer scanning.
|
||||
mScanning.reset(); // No longer scanning.
|
||||
bScanRefresh = true; // Look for more to scan.
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ void ConnectionPool::peerVerified(Peer::ref peer)
|
||||
// XXX Check error.
|
||||
}
|
||||
|
||||
mScanning = Peer::pointer();
|
||||
mScanning.reset();
|
||||
|
||||
scanRefresh(); // Continue scanning.
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ SField sfIndex(STI_HASH256, 258, "index");
|
||||
|
||||
static int initFields()
|
||||
{
|
||||
sfTxnSignature.notSigningField(); sfTxnSignatures.notSigningField();
|
||||
sfSignature.notSigningField();
|
||||
|
||||
sfHighQualityIn.setMeta(SFM_CHANGE); sfHighQualityOut.setMeta(SFM_CHANGE);
|
||||
sfLowQualityIn.setMeta(SFM_CHANGE); sfLowQualityOut.setMeta(SFM_CHANGE);
|
||||
|
||||
|
||||
@@ -60,16 +60,18 @@ public:
|
||||
const int fieldValue; // Code number for protocol
|
||||
std::string fieldName;
|
||||
SF_Meta fieldMeta;
|
||||
bool signingField;
|
||||
|
||||
SField(int fc, SerializedTypeID tid, int fv, const char* fn) :
|
||||
fieldCode(fc), fieldType(tid), fieldValue(fv), fieldName(fn), fieldMeta(SFM_NEVER)
|
||||
fieldCode(fc), fieldType(tid), fieldValue(fv), fieldName(fn), fieldMeta(SFM_NEVER), signingField(true)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mapMutex);
|
||||
codeToField[fieldCode] = this;
|
||||
}
|
||||
|
||||
SField(SerializedTypeID tid, int fv, const char *fn) :
|
||||
fieldCode(FIELD_CODE(tid, fv)), fieldType(tid), fieldValue(fv), fieldName(fn), fieldMeta(SFM_NEVER)
|
||||
fieldCode(FIELD_CODE(tid, fv)), fieldType(tid), fieldValue(fv), fieldName(fn),
|
||||
fieldMeta(SFM_NEVER), signingField(true)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mapMutex);
|
||||
codeToField[fieldCode] = this;
|
||||
@@ -97,6 +99,11 @@ public:
|
||||
bool shouldMetaDel() const { return (fieldMeta == SFM_DELETE) || (fieldMeta == SFM_ALWAYS); }
|
||||
bool shouldMetaMod() const { return (fieldMeta == SFM_CHANGE) || (fieldMeta == SFM_ALWAYS); }
|
||||
void setMeta(SF_Meta m) { fieldMeta = m; }
|
||||
bool isSigningField() const { return signingField; }
|
||||
void notSigningField() { signingField = false; }
|
||||
|
||||
bool shouldInclude(bool withSigningField) const
|
||||
{ return (fieldValue < 256) && (withSigningField || signingField); }
|
||||
|
||||
bool operator==(const SField& f) const { return fieldCode == f.fieldCode; }
|
||||
bool operator!=(const SField& f) const { return fieldCode != f.fieldCode; }
|
||||
|
||||
@@ -190,7 +190,8 @@ AccountState::pointer Ledger::getAccountState(const RippleAddress& accountID)
|
||||
}
|
||||
SerializedLedgerEntry::pointer sle =
|
||||
boost::make_shared<SerializedLedgerEntry>(item->peekSerializer(), item->getTag());
|
||||
if (sle->getType() != ltACCOUNT_ROOT) return AccountState::pointer();
|
||||
if (sle->getType() != ltACCOUNT_ROOT)
|
||||
return AccountState::pointer();
|
||||
return boost::make_shared<AccountState>(sle,accountID);
|
||||
}
|
||||
|
||||
@@ -308,7 +309,7 @@ bool Ledger::getTransaction(const uint256& txID, Transaction::pointer& txn, Tran
|
||||
if (type == SHAMapTreeNode::tnTRANSACTION_NM)
|
||||
{ // in tree with no metadata
|
||||
txn = theApp->getMasterTransaction().fetch(txID, false);
|
||||
meta = TransactionMetaSet::pointer();
|
||||
meta.reset();
|
||||
if (!txn)
|
||||
txn = Transaction::sharedTransaction(item->peekData(), true);
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ bool LedgerAcquire::takeBase(const std::string& data)
|
||||
{
|
||||
cLog(lsWARNING) << "Acquire hash mismatch";
|
||||
cLog(lsWARNING) << mLedger->getHash() << "!=" << mHash;
|
||||
mLedger = Ledger::pointer();
|
||||
mLedger.reset();
|
||||
#ifdef TRUST_NETWORK
|
||||
assert(false);
|
||||
#endif
|
||||
|
||||
@@ -347,7 +347,7 @@ void LedgerConsensus::handleLCL(const uint256& lclHash)
|
||||
|
||||
cLog(lsINFO) << "Have the consensus ledger " << mPrevLedgerHash;
|
||||
mHaveCorrectLCL = true;
|
||||
mAcquiringLedger = LedgerAcquire::pointer();
|
||||
mAcquiringLedger.reset();
|
||||
theApp->getOPs().clearNeedNetworkLedger();
|
||||
mCloseResolution = ContinuousLedgerTiming::getNextLedgerTimeResolution(
|
||||
mPreviousLedger->getCloseResolution(), mPreviousLedger->getCloseAgree(),
|
||||
|
||||
@@ -103,7 +103,7 @@ void LedgerMaster::acquireMissingLedger(const uint256& ledgerHash, uint32 ledger
|
||||
Ledger::pointer lgr = mMissingLedger->getLedger();
|
||||
if (lgr && (lgr->getLedgerSeq() == ledgerSeq))
|
||||
missingAcquireComplete(mMissingLedger);
|
||||
mMissingLedger = LedgerAcquire::pointer();
|
||||
mMissingLedger.reset();
|
||||
return;
|
||||
}
|
||||
mMissingSeq = ledgerSeq;
|
||||
@@ -120,7 +120,7 @@ void LedgerMaster::missingAcquireComplete(LedgerAcquire::pointer acq)
|
||||
cLog(lsWARNING) << "Acquire failed for " << mMissingSeq;
|
||||
}
|
||||
|
||||
mMissingLedger = LedgerAcquire::pointer();
|
||||
mMissingLedger.reset();
|
||||
mMissingSeq = 0;
|
||||
|
||||
if (!acq->isFailed())
|
||||
@@ -147,7 +147,7 @@ void LedgerMaster::setFullLedger(Ledger::ref ledger)
|
||||
}
|
||||
|
||||
if (mMissingLedger && mMissingLedger->isComplete())
|
||||
mMissingLedger = LedgerAcquire::pointer();
|
||||
mMissingLedger.reset();
|
||||
|
||||
if (mMissingLedger || !theConfig.FULL_HISTORY)
|
||||
return;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Application.h"
|
||||
#include "HashPrefixes.h"
|
||||
|
||||
DECLARE_INSTANCE(LedgerProposal);
|
||||
|
||||
LedgerProposal::LedgerProposal(const uint256& pLgr, uint32 seq, const uint256& tx, uint32 closeTime,
|
||||
const RippleAddress& naPeerPublic) :
|
||||
mPreviousLedger(pLgr), mCurrentHash(tx), mCloseTime(closeTime), mProposeSeq(seq), mPublicKey(naPeerPublic)
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
|
||||
#include "RippleAddress.h"
|
||||
#include "Serializer.h"
|
||||
#include "InstanceCounter.h"
|
||||
|
||||
class LedgerProposal
|
||||
DEFINE_INSTANCE(LedgerProposal);
|
||||
|
||||
class LedgerProposal : private IS_INSTANCE(LedgerProposal)
|
||||
{
|
||||
protected:
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ Transaction::pointer NetworkOPs::submitTransaction(const Transaction::pointer& t
|
||||
|
||||
assert(false);
|
||||
|
||||
tpTransNew = Transaction::pointer();
|
||||
tpTransNew.reset();
|
||||
}
|
||||
|
||||
return tpTransNew;
|
||||
@@ -571,7 +571,7 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector<Peer::pointer>& peerLis
|
||||
{
|
||||
mAcquiringLedger->abort();
|
||||
theApp->getMasterLedgerAcquire().dropLedger(mAcquiringLedger->getHash());
|
||||
mAcquiringLedger = LedgerAcquire::pointer();
|
||||
mAcquiringLedger.reset();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void Peer::handle_write(const boost::system::error_code& error, size_t bytes_tra
|
||||
// std::cerr << "Peer::handle_write bytes: "<< bytes_transferred << std::endl;
|
||||
#endif
|
||||
|
||||
mSendingPacket = PackedMessage::pointer();
|
||||
mSendingPacket.reset();
|
||||
|
||||
if (mDetaching)
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ bool SHAMap::walkBranch(SHAMapTreeNode* node, SHAMapItem::ref otherMapItem, bool
|
||||
else differences.insert(std::make_pair(otherMapItem->getTag(),
|
||||
std::make_pair(otherMapItem, item)));
|
||||
if(--maxCount <= 0) return false;
|
||||
item = SHAMapItem::pointer();
|
||||
item.reset();
|
||||
}
|
||||
}
|
||||
else assert(false);
|
||||
|
||||
@@ -500,7 +500,7 @@ int SHAMapTreeNode::getBranchCount() const
|
||||
|
||||
void SHAMapTreeNode::makeInner()
|
||||
{
|
||||
mItem = SHAMapItem::pointer();
|
||||
mItem.reset();
|
||||
memset(mHashes, 0, sizeof(mHashes));
|
||||
mType = tnINNER;
|
||||
mHash.zero();
|
||||
|
||||
@@ -65,7 +65,7 @@ void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint2
|
||||
if (childHash != d->getNodeHash())
|
||||
{
|
||||
cLog(lsERROR) << "Wrong hash from cached object";
|
||||
d = SHAMapTreeNode::pointer();
|
||||
d.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -125,22 +125,22 @@
|
||||
|
||||
// inner object
|
||||
// OBJECT/1 is reserved for end of object
|
||||
FIELD(TemplateEntry, OBJECT, 1)
|
||||
FIELD(TransactionMetaData, OBJECT, 2)
|
||||
FIELD(CreatedNode, OBJECT, 3)
|
||||
FIELD(DeletedNode, OBJECT, 4)
|
||||
FIELD(ModifiedNode, OBJECT, 5)
|
||||
FIELD(PreviousFields, OBJECT, 6)
|
||||
FIELD(FinalFields, OBJECT, 7)
|
||||
FIELD(TemplateEntry, OBJECT, 8)
|
||||
|
||||
// array of objects
|
||||
// ARRAY/1 is reserved for end of array
|
||||
FIELD(AffectedNodes, ARRAY, 1)
|
||||
FIELD(SigningAccounts, ARRAY, 2)
|
||||
FIELD(TxnSignatures, ARRAY, 3)
|
||||
FIELD(Signatures, ARRAY, 4)
|
||||
FIELD(Template, ARRAY, 5)
|
||||
FIELD(Necessary, ARRAY, 6)
|
||||
FIELD(Sufficient, ARRAY, 7)
|
||||
FIELD(AffectedNodes, ARRAY, 8)
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -283,13 +283,8 @@ void STObject::add(Serializer& s, bool withSigningFields) const
|
||||
|
||||
BOOST_FOREACH(const SerializedType& it, mData)
|
||||
{ // pick out the fields and sort them
|
||||
if ((it.getSType() != STI_NOTPRESENT) && it.getFName().isBinary())
|
||||
{
|
||||
SField::ref fName = it.getFName();
|
||||
if (withSigningFields ||
|
||||
((fName != sfTxnSignature) && (fName != sfTxnSignatures) && (fName != sfSignature)))
|
||||
if ((it.getSType() != STI_NOTPRESENT) && it.getFName().shouldInclude(withSigningFields))
|
||||
fields.insert(std::make_pair(it.getFName().fieldCode, &it));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ extern LogPartition TaggedCachePartition;
|
||||
// If it stays in memory even after it is ejected from the cache,
|
||||
// the map will track it.
|
||||
|
||||
// CAUTION: Callers must not modify data objects that are stored in the cache!
|
||||
// CAUTION: Callers must not modify data objects that are stored in the cache
|
||||
// unless they hold their own lock over all cache operations.
|
||||
|
||||
template <typename c_Key, typename c_Data> class TaggedCache
|
||||
{
|
||||
|
||||
@@ -481,7 +481,7 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
|
||||
}
|
||||
}
|
||||
|
||||
mTxnAccount = SLE::pointer();
|
||||
mTxnAccount.reset();
|
||||
mNodes.clear();
|
||||
|
||||
if (!isSetBit(params, tapOPEN_LEDGER)
|
||||
|
||||
@@ -184,7 +184,7 @@ ValidationCollection::getCurrentValidations(uint256 currentLedger)
|
||||
else if (it->second->getSignTime() < cutoff)
|
||||
{ // contains a stale record
|
||||
mStaleValidations.push_back(it->second);
|
||||
it->second = SerializedValidation::pointer();
|
||||
it->second.reset();
|
||||
condWrite();
|
||||
it = mCurrentValidations.erase(it);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user