20
20
#include " utiltime.h"
21
21
#include " version.h"
22
22
23
- using namespace std ;
24
-
25
23
CTxMemPoolEntry::CTxMemPoolEntry (const CTransaction& _tx, const CAmount& _nFee,
26
24
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
27
25
bool poolHasNoInputsOf, CAmount _inChainInputValue,
@@ -449,32 +447,32 @@ void CTxMemPool::addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewC
449
447
const Coin& coin = view.AccessCoin (input.prevout );
450
448
const CTxOut &prevout = coin.out ;
451
449
if (prevout.scriptPubKey .IsPayToScriptHash ()) {
452
- vector<unsigned char > hashBytes (prevout.scriptPubKey .begin ()+2 , prevout.scriptPubKey .begin ()+22 );
450
+ std:: vector<unsigned char > hashBytes (prevout.scriptPubKey .begin ()+2 , prevout.scriptPubKey .begin ()+22 );
453
451
CMempoolAddressDeltaKey key (2 , uint160 (hashBytes), txhash, j, 1 );
454
452
CMempoolAddressDelta delta (entry.GetTime (), prevout.nValue * -1 , input.prevout .hash , input.prevout .n );
455
- mapAddress.insert (make_pair (key, delta));
453
+ mapAddress.insert (std:: make_pair (key, delta));
456
454
inserted.push_back (key);
457
455
} else if (prevout.scriptPubKey .IsPayToPublicKeyHash ()) {
458
- vector<unsigned char > hashBytes (prevout.scriptPubKey .begin ()+3 , prevout.scriptPubKey .begin ()+23 );
456
+ std:: vector<unsigned char > hashBytes (prevout.scriptPubKey .begin ()+3 , prevout.scriptPubKey .begin ()+23 );
459
457
CMempoolAddressDeltaKey key (1 , uint160 (hashBytes), txhash, j, 1 );
460
458
CMempoolAddressDelta delta (entry.GetTime (), prevout.nValue * -1 , input.prevout .hash , input.prevout .n );
461
- mapAddress.insert (make_pair (key, delta));
459
+ mapAddress.insert (std:: make_pair (key, delta));
462
460
inserted.push_back (key);
463
461
}
464
462
}
465
463
466
464
for (unsigned int k = 0 ; k < tx.vout .size (); k++) {
467
465
const CTxOut &out = tx.vout [k];
468
466
if (out.scriptPubKey .IsPayToScriptHash ()) {
469
- vector<unsigned char > hashBytes (out.scriptPubKey .begin ()+2 , out.scriptPubKey .begin ()+22 );
467
+ std:: vector<unsigned char > hashBytes (out.scriptPubKey .begin ()+2 , out.scriptPubKey .begin ()+22 );
470
468
CMempoolAddressDeltaKey key (2 , uint160 (hashBytes), txhash, k, 0 );
471
- mapAddress.insert (make_pair (key, CMempoolAddressDelta (entry.GetTime (), out.nValue )));
469
+ mapAddress.insert (std:: make_pair (key, CMempoolAddressDelta (entry.GetTime (), out.nValue )));
472
470
inserted.push_back (key);
473
471
} else if (out.scriptPubKey .IsPayToPublicKeyHash ()) {
474
- vector<unsigned char > hashBytes (out.scriptPubKey .begin ()+3 , out.scriptPubKey .begin ()+23 );
472
+ std:: vector<unsigned char > hashBytes (out.scriptPubKey .begin ()+3 , out.scriptPubKey .begin ()+23 );
475
473
std::pair<addressDeltaMap::iterator,bool > ret;
476
474
CMempoolAddressDeltaKey key (1 , uint160 (hashBytes), txhash, k, 0 );
477
- mapAddress.insert (make_pair (key, CMempoolAddressDelta (entry.GetTime (), out.nValue )));
475
+ mapAddress.insert (std:: make_pair (key, CMempoolAddressDelta (entry.GetTime (), out.nValue )));
478
476
inserted.push_back (key);
479
477
}
480
478
}
@@ -528,10 +526,10 @@ void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCac
528
526
int addressType;
529
527
530
528
if (prevout.scriptPubKey .IsPayToScriptHash ()) {
531
- addressHash = uint160 (vector<unsigned char > (prevout.scriptPubKey .begin ()+2 , prevout.scriptPubKey .begin ()+22 ));
529
+ addressHash = uint160 (std:: vector<unsigned char > (prevout.scriptPubKey .begin ()+2 , prevout.scriptPubKey .begin ()+22 ));
532
530
addressType = 2 ;
533
531
} else if (prevout.scriptPubKey .IsPayToPublicKeyHash ()) {
534
- addressHash = uint160 (vector<unsigned char > (prevout.scriptPubKey .begin ()+3 , prevout.scriptPubKey .begin ()+23 ));
532
+ addressHash = uint160 (std:: vector<unsigned char > (prevout.scriptPubKey .begin ()+3 , prevout.scriptPubKey .begin ()+23 ));
535
533
addressType = 1 ;
536
534
} else {
537
535
addressHash.SetNull ();
@@ -541,7 +539,7 @@ void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCac
541
539
CSpentIndexKey key = CSpentIndexKey (input.prevout .hash , input.prevout .n );
542
540
CSpentIndexValue value = CSpentIndexValue (txhash, j, -1 , prevout.nValue , addressType, addressHash);
543
541
544
- mapSpent.insert (make_pair (key, value));
542
+ mapSpent.insert (std:: make_pair (key, value));
545
543
inserted.push_back (key);
546
544
547
545
}
@@ -662,7 +660,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
662
660
{
663
661
// Remove transactions spending a coinbase which are now immature and no-longer-final transactions
664
662
LOCK (cs);
665
- list<CTransaction> transactionsToRemove;
663
+ std:: list<CTransaction> transactionsToRemove;
666
664
for (indexed_transaction_set::const_iterator it = mapTx.begin (); it != mapTx.end (); it++) {
667
665
const CTransaction& tx = it->GetTx ();
668
666
LockPoints lp = it->GetLockPoints ();
@@ -689,15 +687,15 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
689
687
}
690
688
}
691
689
BOOST_FOREACH (const CTransaction& tx, transactionsToRemove) {
692
- list<CTransaction> removed;
690
+ std:: list<CTransaction> removed;
693
691
removeRecursive (tx, removed);
694
692
}
695
693
}
696
694
697
695
void CTxMemPool::removeConflicts (const CTransaction &tx, std::list<CTransaction>& removed)
698
696
{
699
697
// Remove transactions which depend on inputs of tx, recursively
700
- list<CTransaction> result;
698
+ std:: list<CTransaction> result;
701
699
LOCK (cs);
702
700
BOOST_FOREACH (const CTxIn &txin, tx.vin ) {
703
701
auto it = mapNextTx.find (txin.prevout );
@@ -780,7 +778,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
780
778
CCoinsViewCache mempoolDuplicate (const_cast <CCoinsViewCache*>(pcoins));
781
779
782
780
LOCK (cs);
783
- list<const CTxMemPoolEntry*> waitingOnDependants;
781
+ std:: list<const CTxMemPoolEntry*> waitingOnDependants;
784
782
for (indexed_transaction_set::const_iterator it = mapTx.begin (); it != mapTx.end (); it++) {
785
783
unsigned int i = 0 ;
786
784
checkTotal += it->GetTxSize ();
@@ -933,7 +931,7 @@ std::vector<CTxMemPool::indexed_transaction_set::const_iterator> CTxMemPool::Get
933
931
return iters;
934
932
}
935
933
936
- void CTxMemPool::queryHashes (vector<uint256>& vtxid)
934
+ void CTxMemPool::queryHashes (std:: vector<uint256>& vtxid)
937
935
{
938
936
LOCK (cs);
939
937
auto iters = GetSortedDepthAndScore ();
@@ -1004,7 +1002,7 @@ CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
1004
1002
{
1005
1003
try {
1006
1004
LOCK (cs);
1007
- fileout << 120000 ; // version required to read: 0.12.00 or later
1005
+ fileout << 1000000 ; // version required to read: 1.0.0.0 or later
1008
1006
fileout << CLIENT_VERSION; // version that wrote the file
1009
1007
minerPolicyEstimator->Write (fileout);
1010
1008
}
@@ -1034,7 +1032,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
1034
1032
return true ;
1035
1033
}
1036
1034
1037
- void CTxMemPool::PrioritiseTransaction (const uint256 hash, const string strHash, double dPriorityDelta, const CAmount& nFeeDelta)
1035
+ void CTxMemPool::PrioritiseTransaction (const uint256 hash, const std:: string strHash, double dPriorityDelta, const CAmount& nFeeDelta)
1038
1036
{
1039
1037
{
1040
1038
LOCK (cs);
@@ -1088,7 +1086,7 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
1088
1086
// If an entry in the mempool exists, always return that one, as it's guaranteed to never
1089
1087
// conflict with the underlying cache, and it cannot have pruned entries (as it contains full)
1090
1088
// transactions. First checking the underlying cache risks returning a pruned entry instead.
1091
- shared_ptr<const CTransaction> ptx = mempool.get (outpoint.hash );
1089
+ std:: shared_ptr<const CTransaction> ptx = mempool.get (outpoint.hash );
1092
1090
if (ptx) {
1093
1091
if (outpoint.n < ptx->vout .size ()) {
1094
1092
coin = Coin (ptx->vout [outpoint.n ], MEMPOOL_HEIGHT, false );
0 commit comments