Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show All 30 Lines | |||||
void CConnmanTest::AddNode(CNode &node) { | void CConnmanTest::AddNode(CNode &node) { | ||||
LOCK(g_connman->cs_vNodes); | LOCK(g_connman->cs_vNodes); | ||||
g_connman->vNodes.push_back(&node); | g_connman->vNodes.push_back(&node); | ||||
} | } | ||||
void CConnmanTest::ClearNodes() { | void CConnmanTest::ClearNodes() { | ||||
LOCK(g_connman->cs_vNodes); | LOCK(g_connman->cs_vNodes); | ||||
for (CNode *node : g_connman->vNodes) { | |||||
delete node; | |||||
} | |||||
Fabien: This part will conflict with https://reviews.bitcoinabc.org/D2918 and https://reviews. | |||||
g_connman->vNodes.clear(); | g_connman->vNodes.clear(); | ||||
} | } | ||||
thread_local FastRandomContext g_insecure_rand_ctx; | thread_local FastRandomContext g_insecure_rand_ctx; | ||||
std::ostream &operator<<(std::ostream &os, const uint256 &num) { | std::ostream &operator<<(std::ostream &os, const uint256 &num) { | ||||
os << num.ToString(); | os << num.ToString(); | ||||
return os; | return os; | ||||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef &tx, | ||||
// Hack to assume either it's completely dependent on other mempool txs or | // Hack to assume either it's completely dependent on other mempool txs or | ||||
// not at all. | // not at all. | ||||
Amount inChainValue = | Amount inChainValue = | ||||
pool && pool->HasNoInputsOf(*tx) ? tx->GetValueOut() : Amount::zero(); | pool && pool->HasNoInputsOf(*tx) ? tx->GetValueOut() : Amount::zero(); | ||||
return CTxMemPoolEntry(tx, nFee, nTime, dPriority, nHeight, inChainValue, | return CTxMemPoolEntry(tx, nFee, nTime, dPriority, nHeight, inChainValue, | ||||
spendsCoinbase, sigOpCost, lp); | spendsCoinbase, sigOpCost, lp); | ||||
} | } | ||||
This part will conflict with https://reviews.bitcoinabc.org/D2918 and https://reviews.bitcoinabc.org/D2919 and cause double free (see build failure).