mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge c2f2abd0a4 into merged_master (Bitcoin PR bitcoin/bitcoin#27125)
This commit is contained in:
commit
b1d470027d
33 changed files with 195 additions and 176 deletions
|
|
@ -51,9 +51,6 @@
|
|||
#include <optional>
|
||||
#include <typeinfo>
|
||||
|
||||
using node::ReadBlockFromDisk;
|
||||
using node::ReadRawBlockFromDisk;
|
||||
|
||||
/** How long to cache transactions in mapRelay for normal relay */
|
||||
static constexpr auto RELAY_TX_CACHE_TIME = 15min;
|
||||
/** How long a transaction has to be in the mempool before it can unconditionally be relayed (even when not in mapRelay). */
|
||||
|
|
@ -2193,7 +2190,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
|
|||
// Fast-path: in this case it is possible to serve the block directly from disk,
|
||||
// as the network format matches the format on disk
|
||||
std::vector<uint8_t> block_data;
|
||||
if (!ReadRawBlockFromDisk(block_data, pindex->GetBlockPos(), m_chainparams.MessageStart())) {
|
||||
if (!m_chainman.m_blockman.ReadRawBlockFromDisk(block_data, pindex->GetBlockPos(), m_chainparams.MessageStart())) {
|
||||
assert(!"cannot load block from disk");
|
||||
}
|
||||
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, Span{block_data}));
|
||||
|
|
@ -2201,7 +2198,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
|
|||
} else {
|
||||
// Send block from disk
|
||||
std::shared_ptr<CBlock> pblockRead = std::make_shared<CBlock>();
|
||||
if (!ReadBlockFromDisk(*pblockRead, pindex, m_chainparams.GetConsensus())) {
|
||||
if (!m_chainman.m_blockman.ReadBlockFromDisk(*pblockRead, *pindex)) {
|
||||
assert(!"cannot load block from disk");
|
||||
}
|
||||
pblock = pblockRead;
|
||||
|
|
@ -3941,7 +3938,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||
|
||||
if (pindex->nHeight >= m_chainman.ActiveChain().Height() - MAX_BLOCKTXN_DEPTH) {
|
||||
CBlock block;
|
||||
bool ret = ReadBlockFromDisk(block, pindex, m_chainparams.GetConsensus());
|
||||
const bool ret{m_chainman.m_blockman.ReadBlockFromDisk(block, *pindex)};
|
||||
assert(ret);
|
||||
|
||||
SendBlockTransactions(pfrom, *peer, block, req);
|
||||
|
|
@ -5615,7 +5612,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||
m_connman.PushMessage(pto, std::move(cached_cmpctblock_msg.value()));
|
||||
} else {
|
||||
CBlock block;
|
||||
bool ret = ReadBlockFromDisk(block, pBestIndex, consensusParams);
|
||||
const bool ret{m_chainman.m_blockman.ReadBlockFromDisk(block, *pBestIndex)};
|
||||
assert(ret);
|
||||
CBlockHeaderAndShortTxIDs cmpctblock{block};
|
||||
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::CMPCTBLOCK, cmpctblock));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue