Merge #6163: fix: use blocks-only instead of address-only for inventory

3468ab34d1 fix: use blocks-only instead of address-only for inventory (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Mobile client (without full blockchain) can't receive transactions before they are mined in the block.

  ## What was done?
  Fixed a condition "is an addr relay" to "not a block relay".
  It's an alternate solution for https://github.com/dashpay/dash/pull/6162

  ## How Has This Been Tested?
  Tested with hashengineering - it works!

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK [3468ab3](3468ab34d1); no diff
  kwvg:
    utACK 3468ab34d1

Tree-SHA512: 6ad257a72be0f2fd4d7a8e3674d537e2a2c5f0c7c1bdfdf825403d8cb2975261bcf4574949fb02a16de76762d3f30b40e094be448cfa4ee6bae9f1f5be5f44d5
This commit is contained in:
pasta 2024-08-01 09:23:09 -05:00
commit 2379462294
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -2589,7 +2589,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
} }
++it; ++it;
if (!peer.m_addr_relay_enabled && NetMessageViolatesBlocksOnly(inv.GetCommand())) { if (peer.m_block_relay_only && NetMessageViolatesBlocksOnly(inv.GetCommand())) {
// Note that if we receive a getdata for non-block messages // Note that if we receive a getdata for non-block messages
// from a block-relay-only outbound peer that violate the policy, // from a block-relay-only outbound peer that violate the policy,
// we skip such getdata messages from this peer // we skip such getdata messages from this peer