Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <interfaces/chain.h> | #include <interfaces/chain.h> | ||||
#include <chain.h> | #include <chain.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <interfaces/wallet.h> | #include <interfaces/wallet.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <net_processing.h> | |||||
#include <node/coin.h> | #include <node/coin.h> | ||||
#include <policy/mempool.h> | #include <policy/mempool.h> | ||||
#include <policy/policy.h> | #include <policy/policy.h> | ||||
#include <policy/settings.h> | #include <policy/settings.h> | ||||
#include <primitives/block.h> | #include <primitives/block.h> | ||||
#include <primitives/blockhash.h> | #include <primitives/blockhash.h> | ||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <protocol.h> | #include <protocol.h> | ||||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | public: | ||||
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 = ::g_mempool.GetIter(txid); | auto it = ::g_mempool.GetIter(txid); | ||||
return it && (*it)->GetCountWithDescendants() > 1; | return it && (*it)->GetCountWithDescendants() > 1; | ||||
} | } | ||||
void relayTransaction(const TxId &txid) override { | void relayTransaction(const TxId &txid) override { | ||||
CInv inv(MSG_TX, txid); | RelayTransaction(txid, *g_connman); | ||||
g_connman->ForEachNode( | |||||
[&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(const 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); | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |