forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate ASN bucketing in Addrman and add tests
Instead of using /16 netgroups to bucket nodes in Addrman for connection diversification, ASN, which better represents an actor in terms of network-layer infrastructure, is used. For testing, asmap.raw is used. It represents a minimal asmap needed for testing purposes.
- Loading branch information
1 parent
8feb4e4
commit ec45646
Showing
11 changed files
with
473 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,8 @@ JSON_TEST_FILES = \ | |
test/data/tx_invalid.json \ | ||
test/data/tx_valid.json | ||
|
||
RAW_TEST_FILES = | ||
RAW_TEST_FILES = \ | ||
test/data/asmap.raw | ||
|
||
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) | ||
|
||
|
@@ -429,3 +430,12 @@ endif | |
echo "};};"; \ | ||
} > "[email protected]" && mv -f "[email protected]" "$@" | ||
@echo "Generated $@" | ||
|
||
%.raw.h: %.raw | ||
@$(MKDIR_P) $(@D) | ||
@{ \ | ||
echo "static unsigned const char $(*F)_raw[] = {" && \ | ||
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \ | ||
echo "};"; \ | ||
} > "[email protected]" && mv -f "[email protected]" "$@" | ||
@echo "Generated $@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.