mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge UP TO e42ba134f4 into merged_master (UP TO Bitcoin PR bitcoin/bitcoin#26448)
1667577042 2022-11-04T16:50:42+01:00e42ba134f4Bitcoin Merge bitcoin/bitcoin#26448: test: fix intermittent failure in p2p_sendtxrcncl.py 1667576919 2022-11-04T15:48:39+00:0083cf055befBitcoin Merge bitcoin/bitcoin#26443: doc: mention BIP86 in doc/bips.md 1667478613 2022-11-03T13:30:13+01:0028653a596aBitcoin Merge bitcoin/bitcoin#26445: .python-version: bump patch version to 3.6.15 1667471345 2022-11-03T10:29:05+00:002a7c9984dbBitcoin Merge bitcoin/bitcoin#25248: refactor: Add LIFETIMEBOUND / -Wdangling-gsl to Assert() 1667397640 2022-11-02T15:00:40+01:005274f32437Bitcoin Merge bitcoin/bitcoin#26417: test: fix intermittent failure in feature_index_prune.py 1667372848 2022-11-02T08:07:28+01:0039f026b1ecBitcoin Merge bitcoin/bitcoin#26396: net: Avoid SetTxRelay for feeler connections 1667316369 2022-11-01T16:26:09+01:00bf0cb43990Bitcoin Merge bitcoin/bitcoin#26437: test: remove unused `CHANGE_{XPRV,XPUB}` constants 1667300957 2022-11-01T11:09:17+00:005668ccec1dBitcoin Merge bitcoin/bitcoin#25548: gui: Check for readlink buffer overflow and handle gracefully 1667297563 2022-11-01T10:12:43+00:00c041d8f2c9Bitcoin Merge bitcoin/bitcoin#26360: build: remove threadinterrupt from libbitcoinkernel 1667297149 2022-11-01T10:05:49+00:0027e76afe24Bitcoin Merge bitcoin/bitcoin#26294: build: move util/url to common/url 1667291397 2022-11-01T08:29:57+00:00d08b63baa0Bitcoin Merge bitcoin/bitcoin#26373: Update minisketch subtree to latest upstream 1667230521 2022-10-31T15:35:21+00:0043e813cab2Bitcoin Merge bitcoin/bitcoin#26387: p2p: TryLowWorkHeadersSync follow-ups 1667217075 2022-10-31T11:51:15+00:004766cd1981Bitcoin Merge bitcoin/bitcoin#24051: Bugfix: configure: bitcoin-{cli,tx,util} don't need UPnP, NAT-PMP, or ZMQ 1667213203 2022-10-31T11:46:43+01:002856dee808Bitcoin Merge bitcoin/bitcoin#26402: doc: Fix typos 1667202170 2022-10-31T08:42:50+01:00c75c0d8e11Bitcoin Merge bitcoin/bitcoin#26424: doc: correct deriveaddresses RPC name 1667034850 2022-10-29T11:14:10+02:004f270d2b63Bitcoin Merge bitcoin/bitcoin#26404: test: fix intermittent failure in rpc_getblockfrompeer.py 1667030363 2022-10-29T09:59:23+02:00984a01589bBitcoin Merge bitcoin/bitcoin#26408: test: Remove spam from debug log 1666985837 2022-10-28T15:37:17-04:008b050762b1Bitcoin Merge bitcoin/bitcoin#26409: refactor: Silence GCC Wmissing-field-initializers in ChainstateManagerOpts 1666949533 2022-10-28T11:32:13+02:001bad29fe02Bitcoin Merge bitcoin/bitcoin#26377: test: Make `system_tests/run_command` test locale and platform agnostic
This commit is contained in:
commit
b83abdf89a
35 changed files with 102 additions and 95 deletions
|
|
@ -395,9 +395,7 @@ struct Peer {
|
|||
private:
|
||||
Mutex m_tx_relay_mutex;
|
||||
|
||||
/** Transaction relay data. Will be a nullptr if we're not relaying
|
||||
* transactions with this peer (e.g. if it's a block-relay-only peer or
|
||||
* the peer has sent us fRelay=false with bloom filters disabled). */
|
||||
/** Transaction relay data. May be a nullptr. */
|
||||
std::unique_ptr<TxRelay> m_tx_relay GUARDED_BY(m_tx_relay_mutex);
|
||||
};
|
||||
|
||||
|
|
@ -638,9 +636,8 @@ private:
|
|||
* @param[in] chain_start_header Where these headers connect in our index.
|
||||
* @param[in,out] headers The headers to be processed.
|
||||
*
|
||||
* @return True if chain was low work and a headers sync was
|
||||
* initiated (and headers will be empty after calling); false
|
||||
* otherwise.
|
||||
* @return True if chain was low work (headers will be empty after
|
||||
* calling); false otherwise.
|
||||
*/
|
||||
bool TryLowWorkHeadersSync(Peer& peer, CNode& pfrom,
|
||||
const CBlockIndex* chain_start_header,
|
||||
|
|
@ -2567,14 +2564,10 @@ bool PeerManagerImpl::TryLowWorkHeadersSync(Peer& peer, CNode& pfrom, const CBlo
|
|||
peer.m_headers_sync.reset(new HeadersSyncState(peer.m_id, m_chainparams.GetConsensus(),
|
||||
chain_start_header, minimum_chain_work));
|
||||
|
||||
// Now a HeadersSyncState object for tracking this synchronization is created,
|
||||
// process the headers using it as normal.
|
||||
if (!IsContinuationOfLowWorkHeadersSync(peer, pfrom, headers)) {
|
||||
// Something went wrong, reset the headers sync.
|
||||
peer.m_headers_sync.reset(nullptr);
|
||||
LOCK(m_headers_presync_mutex);
|
||||
m_headers_presync_stats.erase(peer.m_id);
|
||||
}
|
||||
// Now a HeadersSyncState object for tracking this synchronization
|
||||
// is created, process the headers using it as normal. Failures are
|
||||
// handled inside of IsContinuationOfLowWorkHeadersSync.
|
||||
(void)IsContinuationOfLowWorkHeadersSync(peer, pfrom, headers);
|
||||
} else {
|
||||
LogPrint(BCLog::NET, "Ignoring low-work chain (height=%u) from peer=%d\n", chain_start_header->nHeight + headers.size(), pfrom.GetId());
|
||||
}
|
||||
|
|
@ -3314,12 +3307,14 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||
}
|
||||
peer->m_starting_height = starting_height;
|
||||
|
||||
// We only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// Only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// - this isn't an outbound block-relay-only connection, and
|
||||
// - this isn't an outbound feeler connection, and
|
||||
// - fRelay=true (the peer wishes to receive transaction announcements)
|
||||
// or we're offering NODE_BLOOM to this peer. NODE_BLOOM means that
|
||||
// the peer may turn on transaction relay later.
|
||||
if (!pfrom.IsBlockOnlyConn() &&
|
||||
!pfrom.IsFeelerConn() &&
|
||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||
auto* const tx_relay = peer->SetTxRelay();
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue