Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6f5fc3

Browse files
Cleanup and Standardise
1 parent 2592434 commit d6f5fc3

File tree

5 files changed

+53
-61
lines changed

5 files changed

+53
-61
lines changed

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,14 @@ bool CConnman::CheckIncomingNonce(uint64_t nonce)
344344
CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, bool fConnectToDynode)
345345
{
346346
// TODO: This is different from what we have in Bitcoin which only calls ConnectNode from OpenNetworkConnection
347-
// If we ever switch to using OpenNetworkConnection for MNs as well, this can be removed
347+
// If we ever switch to using OpenNetworkConnection for DNs as well, this can be removed
348348
if (!fNetworkActive) {
349349
return NULL;
350350
}
351351

352352
if (pszDest == NULL) {
353353
// we clean dynode connections in CDynodeMan::ProcessDynodeConnections()
354-
// so should be safe to skip this and connect to local Hot MN on CActiveDynode::ManageState()
354+
// so should be safe to skip this and connect to local Hot DN on CActiveDynode::ManageState()
355355
if (IsLocal(addrConnect) && !fConnectToDynode)
356356
return NULL;
357357

src/test/addrman_tests.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "netbase.h"
1212
#include "random.h"
1313

14-
using namespace std;
15-
1614
class CAddrManTest : public CAddrMan
1715
{
1816
uint64_t state;
@@ -183,8 +181,8 @@ BOOST_AUTO_TEST_CASE(addrman_select)
183181

184182
// Add three addresses to new table.
185183
CService addr2 = ResolveService("250.3.1.1", 8333);
186-
CService addr3 = ResolveService("250.3.2.2", 9999);
187-
CService addr4 = ResolveService("250.3.3.3", 9999);
184+
CService addr3 = ResolveService("250.3.2.2", 33300);
185+
CService addr4 = ResolveService("250.3.3.3", 33300);
188186

189187
addrman.Add(CAddress(addr2, NODE_NONE), ResolveService("250.3.1.1", 8333));
190188
addrman.Add(CAddress(addr3, NODE_NONE), ResolveService("250.3.1.1", 8333));
@@ -207,8 +205,8 @@ BOOST_AUTO_TEST_CASE(addrman_select)
207205

208206
// Test 12: Select pulls from new and tried regardless of port number.
209207
BOOST_CHECK(addrman.Select().ToString() == "250.4.6.6:8333");
210-
BOOST_CHECK(addrman.Select().ToString() == "250.3.2.2:9999");
211-
BOOST_CHECK(addrman.Select().ToString() == "250.3.3.3:9999");
208+
BOOST_CHECK(addrman.Select().ToString() == "250.3.2.2:33300");
209+
BOOST_CHECK(addrman.Select().ToString() == "250.3.3.3:33300");
212210
BOOST_CHECK(addrman.Select().ToString() == "250.4.4.4:8333");
213211
}
214212

@@ -282,7 +280,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
282280
BOOST_CHECK(addrman.size() == 0);
283281

284282
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
285-
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
283+
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 33300), NODE_NONE);
286284
CAddress addr3 = CAddress(ResolveService("251.255.2.1", 8333), NODE_NONE);
287285

288286
CNetAddr source1 = ResolveIP("250.1.2.1");
@@ -367,12 +365,12 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
367365
// Test 22: Sanity check, GetAddr should never return anything if addrman
368366
// is empty.
369367
BOOST_CHECK(addrman.size() == 0);
370-
vector<CAddress> vAddr1 = addrman.GetAddr();
368+
std::vector<CAddress> vAddr1 = addrman.GetAddr();
371369
BOOST_CHECK(vAddr1.size() == 0);
372370

373371
CAddress addr1 = CAddress(ResolveService("250.250.2.1", 8333), NODE_NONE);
374372
addr1.nTime = GetAdjustedTime(); // Set time so isTerrible = false
375-
CAddress addr2 = CAddress(ResolveService("250.251.2.2", 9999), NODE_NONE);
373+
CAddress addr2 = CAddress(ResolveService("250.251.2.2", 33300), NODE_NONE);
376374
addr2.nTime = GetAdjustedTime();
377375
CAddress addr3 = CAddress(ResolveService("251.252.2.3", 8333), NODE_NONE);
378376
addr3.nTime = GetAdjustedTime();
@@ -403,7 +401,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
403401
int octet1 = i % 256;
404402
int octet2 = (i / 256) % 256;
405403
int octet3 = (i / (256 * 2)) % 256;
406-
string strAddr = boost::to_string(octet1) + "." + boost::to_string(octet2) + "." + boost::to_string(octet3) + ".23";
404+
std::string strAddr = boost::to_string(octet1) + "." + boost::to_string(octet2) + "." + boost::to_string(octet3) + ".23";
407405
CAddress addr = CAddress(ResolveService(strAddr), NODE_NONE);
408406

409407
// Ensure that for all addrs in addrman, isTerrible == false.
@@ -412,7 +410,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
412410
if (i % 8 == 0)
413411
addrman.Good(addr);
414412
}
415-
vector<CAddress> vAddr = addrman.GetAddr();
413+
std::vector<CAddress> vAddr = addrman.GetAddr();
416414

417415
size_t percent23 = (addrman.size() * 23) / 100;
418416
BOOST_CHECK(vAddr.size() == percent23);
@@ -430,7 +428,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
430428
addrman.MakeDeterministic();
431429

432430
CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE);
433-
CAddress addr2 = CAddress(ResolveService("250.1.1.1", 9999), NODE_NONE);
431+
CAddress addr2 = CAddress(ResolveService("250.1.1.1", 33300), NODE_NONE);
434432

435433
CNetAddr source1 = ResolveIP("250.1.1.1");
436434

@@ -454,7 +452,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
454452
BOOST_CHECK(info1.GetKey() != info2.GetKey());
455453
BOOST_CHECK(info1.GetTriedBucket(nKey1) != info2.GetTriedBucket(nKey1));
456454

457-
set<int> buckets;
455+
std::set<int> buckets;
458456
for (int i = 0; i < 255; i++) {
459457
CAddrInfo infoi = CAddrInfo(
460458
CAddress(ResolveService("250.1.1." + boost::to_string(i)), NODE_NONE),
@@ -487,7 +485,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
487485
addrman.MakeDeterministic();
488486

489487
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
490-
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
488+
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 33300), NODE_NONE);
491489

492490
CNetAddr source1 = ResolveIP("250.1.2.1");
493491

@@ -507,7 +505,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
507505
BOOST_CHECK(info1.GetKey() != info2.GetKey());
508506
BOOST_CHECK(info1.GetNewBucket(nKey1) == info2.GetNewBucket(nKey1));
509507

510-
set<int> buckets;
508+
std::set<int> buckets;
511509
for (int i = 0; i < 255; i++) {
512510
CAddrInfo infoi = CAddrInfo(
513511
CAddress(ResolveService("250.1.1." + boost::to_string(i)), NODE_NONE),

src/test/net_tests.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include "netbase.h"
1313
#include "chainparams.h"
1414

15-
using namespace std;
16-
1715
class CAddrManSerializationMock : public CAddrMan
1816
{
1917
public:
@@ -68,7 +66,7 @@ CDataStream AddrmanToStream(CAddrManSerializationMock& addrman)
6866
ssPeersIn << FLATDATA(Params().MessageStart());
6967
ssPeersIn << addrman;
7068
std::string str = ssPeersIn.str();
71-
vector<unsigned char> vchData(str.begin(), str.end());
69+
std::vector<unsigned char> vchData(str.begin(), str.end());
7270
return CDataStream(vchData, SER_DISK, CLIENT_VERSION);
7371
}
7472

@@ -81,8 +79,8 @@ BOOST_AUTO_TEST_CASE(caddrdb_read)
8179

8280
CService addr1, addr2, addr3;
8381
Lookup("250.7.1.1", addr1, 8333, false);
84-
Lookup("250.7.2.2", addr2, 9999, false);
85-
Lookup("250.7.3.3", addr3, 9999, false);
82+
Lookup("250.7.2.2", addr2, 33300, false);
83+
Lookup("250.7.3.3", addr3, 33300, false);
8684

8785
// Add three addresses to new table.
8886
CService source;

src/test/netbase_tests.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <boost/assign/list_of.hpp>
1212
#include <boost/test/unit_test.hpp>
1313

14-
using namespace std;
15-
1614
BOOST_FIXTURE_TEST_SUITE(netbase_tests, BasicTestingSetup)
1715

1816
static CNetAddr ResolveIP(const char* ip)
@@ -65,9 +63,9 @@ BOOST_AUTO_TEST_CASE(netbase_properties)
6563

6664
}
6765

68-
bool static TestSplitHost(string test, string host, int port)
66+
bool static TestSplitHost(std::string test, std::string host, int port)
6967
{
70-
string hostOut;
68+
std::string hostOut;
7169
int portOut = -1;
7270
SplitHostPort(test, portOut, hostOut);
7371
return hostOut == host && port == portOut;
@@ -80,19 +78,19 @@ BOOST_AUTO_TEST_CASE(netbase_splithost)
8078
BOOST_CHECK(TestSplitHost("www.bitcoin.org:80", "www.bitcoin.org", 80));
8179
BOOST_CHECK(TestSplitHost("[www.bitcoin.org]:80", "www.bitcoin.org", 80));
8280
BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", -1));
83-
BOOST_CHECK(TestSplitHost("127.0.0.1:9999", "127.0.0.1", 9999));
81+
BOOST_CHECK(TestSplitHost("127.0.0.1:33300", "127.0.0.1", 33300));
8482
BOOST_CHECK(TestSplitHost("[127.0.0.1]", "127.0.0.1", -1));
85-
BOOST_CHECK(TestSplitHost("[127.0.0.1]:9999", "127.0.0.1", 9999));
83+
BOOST_CHECK(TestSplitHost("[127.0.0.1]:33300", "127.0.0.1", 33300));
8684
BOOST_CHECK(TestSplitHost("::ffff:127.0.0.1", "::ffff:127.0.0.1", -1));
87-
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:9999", "::ffff:127.0.0.1", 9999));
88-
BOOST_CHECK(TestSplitHost("[::]:9999", "::", 9999));
89-
BOOST_CHECK(TestSplitHost("::9999", "::9999", -1));
90-
BOOST_CHECK(TestSplitHost(":9999", "", 9999));
91-
BOOST_CHECK(TestSplitHost("[]:9999", "", 9999));
85+
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:33300", "::ffff:127.0.0.1", 33300));
86+
BOOST_CHECK(TestSplitHost("[::]:33300", "::", 33300));
87+
BOOST_CHECK(TestSplitHost("::33300", "::33300", -1));
88+
BOOST_CHECK(TestSplitHost(":33300", "", 33300));
89+
BOOST_CHECK(TestSplitHost("[]:33300", "", 33300));
9290
BOOST_CHECK(TestSplitHost("", "", -1));
9391
}
9492

95-
bool static TestParse(string src, string canon)
93+
bool static TestParse(std::string src, std::string canon)
9694
{
9795
CService addr(LookupNumeric(src.c_str(), 65535));
9896
return canon == addr.ToString();
@@ -101,10 +99,10 @@ bool static TestParse(string src, string canon)
10199
BOOST_AUTO_TEST_CASE(netbase_lookupnumeric)
102100
{
103101
BOOST_CHECK(TestParse("127.0.0.1", "127.0.0.1:65535"));
104-
BOOST_CHECK(TestParse("127.0.0.1:9999", "127.0.0.1:9999"));
102+
BOOST_CHECK(TestParse("127.0.0.1:33300", "127.0.0.1:33300"));
105103
BOOST_CHECK(TestParse("::ffff:127.0.0.1", "127.0.0.1:65535"));
106104
BOOST_CHECK(TestParse("::", "[::]:65535"));
107-
BOOST_CHECK(TestParse("[::]:9999", "[::]:9999"));
105+
BOOST_CHECK(TestParse("[::]:33300", "[::]:33300"));
108106
BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535"));
109107
BOOST_CHECK(TestParse(":::", "[::]:0"));
110108
}
@@ -279,11 +277,11 @@ BOOST_AUTO_TEST_CASE(netbase_getgroup)
279277
BOOST_CHECK(ResolveIP("1.2.3.4").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // IPv4
280278
BOOST_CHECK(ResolveIP("::FFFF:0:102:304").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC6145
281279
BOOST_CHECK(ResolveIP("64:FF9B::102:304").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC6052
282-
BOOST_CHECK(ResolveIP("2002:102:304:9999:9999:9999:9999:9999").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC3964
283-
BOOST_CHECK(ResolveIP("2001:0:9999:9999:9999:9999:FEFD:FCFB").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC4380
280+
BOOST_CHECK(ResolveIP("2002:102:304:33300:33300:33300:33300:33300").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC3964
281+
BOOST_CHECK(ResolveIP("2001:0:33300:33300:33300:33300:FEFD:FCFB").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV4)(1)(2)); // RFC4380
284282
BOOST_CHECK(ResolveIP("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").GetGroup() == boost::assign::list_of((unsigned char)NET_TOR)(239)); // Tor
285-
BOOST_CHECK(ResolveIP("2001:470:abcd:9999:9999:9999:9999:9999").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV6)(32)(1)(4)(112)(175)); //he.net
286-
BOOST_CHECK(ResolveIP("2001:2001:9999:9999:9999:9999:9999:9999").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV6)(32)(1)(32)(1)); //IPv6
283+
BOOST_CHECK(ResolveIP("2001:470:abcd:33300:33300:33300:33300:33300").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV6)(32)(1)(4)(112)(175)); //he.net
284+
BOOST_CHECK(ResolveIP("2001:2001:33300:33300:33300:33300:33300:33300").GetGroup() == boost::assign::list_of((unsigned char)NET_IPV6)(32)(1)(32)(1)); //IPv6
287285

288286
}
289287

src/txmempool.cpp

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "utiltime.h"
2121
#include "version.h"
2222

23-
using namespace std;
24-
2523
CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee,
2624
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
2725
bool poolHasNoInputsOf, CAmount _inChainInputValue,
@@ -449,32 +447,32 @@ void CTxMemPool::addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewC
449447
const Coin& coin = view.AccessCoin(input.prevout);
450448
const CTxOut &prevout = coin.out;
451449
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);
453451
CMempoolAddressDeltaKey key(2, uint160(hashBytes), txhash, j, 1);
454452
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));
456454
inserted.push_back(key);
457455
} 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);
459457
CMempoolAddressDeltaKey key(1, uint160(hashBytes), txhash, j, 1);
460458
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));
462460
inserted.push_back(key);
463461
}
464462
}
465463

466464
for (unsigned int k = 0; k < tx.vout.size(); k++) {
467465
const CTxOut &out = tx.vout[k];
468466
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);
470468
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)));
472470
inserted.push_back(key);
473471
} 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);
475473
std::pair<addressDeltaMap::iterator,bool> ret;
476474
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)));
478476
inserted.push_back(key);
479477
}
480478
}
@@ -528,10 +526,10 @@ void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCac
528526
int addressType;
529527

530528
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));
532530
addressType = 2;
533531
} 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));
535533
addressType = 1;
536534
} else {
537535
addressHash.SetNull();
@@ -541,7 +539,7 @@ void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCac
541539
CSpentIndexKey key = CSpentIndexKey(input.prevout.hash, input.prevout.n);
542540
CSpentIndexValue value = CSpentIndexValue(txhash, j, -1, prevout.nValue, addressType, addressHash);
543541

544-
mapSpent.insert(make_pair(key, value));
542+
mapSpent.insert(std::make_pair(key, value));
545543
inserted.push_back(key);
546544

547545
}
@@ -662,7 +660,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
662660
{
663661
// Remove transactions spending a coinbase which are now immature and no-longer-final transactions
664662
LOCK(cs);
665-
list<CTransaction> transactionsToRemove;
663+
std::list<CTransaction> transactionsToRemove;
666664
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {
667665
const CTransaction& tx = it->GetTx();
668666
LockPoints lp = it->GetLockPoints();
@@ -689,15 +687,15 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
689687
}
690688
}
691689
BOOST_FOREACH(const CTransaction& tx, transactionsToRemove) {
692-
list<CTransaction> removed;
690+
std::list<CTransaction> removed;
693691
removeRecursive(tx, removed);
694692
}
695693
}
696694

697695
void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>& removed)
698696
{
699697
// Remove transactions which depend on inputs of tx, recursively
700-
list<CTransaction> result;
698+
std::list<CTransaction> result;
701699
LOCK(cs);
702700
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
703701
auto it = mapNextTx.find(txin.prevout);
@@ -780,7 +778,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
780778
CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins));
781779

782780
LOCK(cs);
783-
list<const CTxMemPoolEntry*> waitingOnDependants;
781+
std::list<const CTxMemPoolEntry*> waitingOnDependants;
784782
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {
785783
unsigned int i = 0;
786784
checkTotal += it->GetTxSize();
@@ -933,7 +931,7 @@ std::vector<CTxMemPool::indexed_transaction_set::const_iterator> CTxMemPool::Get
933931
return iters;
934932
}
935933

936-
void CTxMemPool::queryHashes(vector<uint256>& vtxid)
934+
void CTxMemPool::queryHashes(std::vector<uint256>& vtxid)
937935
{
938936
LOCK(cs);
939937
auto iters = GetSortedDepthAndScore();
@@ -1004,7 +1002,7 @@ CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
10041002
{
10051003
try {
10061004
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
10081006
fileout << CLIENT_VERSION; // version that wrote the file
10091007
minerPolicyEstimator->Write(fileout);
10101008
}
@@ -1034,7 +1032,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
10341032
return true;
10351033
}
10361034

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)
10381036
{
10391037
{
10401038
LOCK(cs);
@@ -1088,7 +1086,7 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
10881086
// If an entry in the mempool exists, always return that one, as it's guaranteed to never
10891087
// conflict with the underlying cache, and it cannot have pruned entries (as it contains full)
10901088
// 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);
10921090
if (ptx) {
10931091
if (outpoint.n < ptx->vout.size()) {
10941092
coin = Coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false);

0 commit comments

Comments
 (0)