mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
PeerGroup: check required services on discovered addresses via addr/addrv2
If the discovered peer has the required services, mark it with a slightly higher priority than peers discovered via `PeerDiscovery`.
This commit is contained in:
parent
1a30c00df8
commit
a9b9af8102
1 changed files with 4 additions and 2 deletions
|
@ -319,8 +319,10 @@ public class PeerGroup implements TransactionBroadcaster {
|
|||
Collections.shuffle(addresses);
|
||||
int numAdded = 0;
|
||||
for (PeerAddress address : addresses) {
|
||||
// Add to inactive pool.
|
||||
boolean added = addInactive(address, 0);
|
||||
if (!address.getServices().has(requiredServices))
|
||||
continue;
|
||||
// Add to inactive pool with slightly elevated priority because services fit.
|
||||
boolean added = addInactive(address, 1);
|
||||
if (added)
|
||||
numAdded++;
|
||||
// Limit addresses picked per message.
|
||||
|
|
Loading…
Add table
Reference in a new issue