Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
double guessVerificationProgress(const BlockHash &block_hash) override { | double guessVerificationProgress(const BlockHash &block_hash) override { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
return GuessVerificationProgress(Params().TxData(), | return GuessVerificationProgress(Params().TxData(), | ||||
LookupBlockIndex(block_hash)); | LookupBlockIndex(block_hash)); | ||||
} | } | ||||
bool hasDescendantsInMempool(const TxId &txid) override { | bool hasDescendantsInMempool(const TxId &txid) override { | ||||
LOCK(::g_mempool.cs); | LOCK(::g_mempool.cs); | ||||
auto it_mp = ::g_mempool.mapTx.find(txid); | auto it = ::g_mempool.GetIter(txid); | ||||
return it_mp != ::g_mempool.mapTx.end() && | return it && (*it)->GetCountWithDescendants() > 1; | ||||
it_mp->GetCountWithDescendants() > 1; | |||||
} | } | ||||
void relayTransaction(const TxId &txid) override { | void relayTransaction(const TxId &txid) override { | ||||
CInv inv(MSG_TX, txid); | CInv inv(MSG_TX, txid); | ||||
g_connman->ForEachNode( | g_connman->ForEachNode( | ||||
[&inv](CNode *node) { node->PushInventory(inv); }); | [&inv](CNode *node) { node->PushInventory(inv); }); | ||||
} | } | ||||
void getTransactionAncestry(const TxId &txid, size_t &ancestors, | void getTransactionAncestry(const TxId &txid, size_t &ancestors, | ||||
size_t &descendants) override { | size_t &descendants) override { | ||||
::g_mempool.GetTransactionAncestry(txid, ancestors, descendants); | ::g_mempool.GetTransactionAncestry(txid, ancestors, descendants); | ||||
} | } | ||||
bool checkChainLimits(CTransactionRef tx) override { | bool checkChainLimits(const CTransactionRef &tx) override { | ||||
LockPoints lp; | LockPoints lp; | ||||
CTxMemPoolEntry entry(tx, Amount(), 0, 0, false, 0, lp); | CTxMemPoolEntry entry(tx, Amount(), 0, 0, false, 0, lp); | ||||
CTxMemPool::setEntries ancestors; | CTxMemPool::setEntries ancestors; | ||||
auto limit_ancestor_count = | auto limit_ancestor_count = | ||||
gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); | gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); | ||||
auto limit_ancestor_size = | auto limit_ancestor_size = | ||||
gArgs.GetArg("-limitancestorsize", | gArgs.GetArg("-limitancestorsize", | ||||
DEFAULT_ANCESTOR_SIZE_LIMIT) * | DEFAULT_ANCESTOR_SIZE_LIMIT) * | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |