HomePhabricator

Update seeder files to use fprintf() instead of printf()

Description

Update seeder files to use fprintf() instead of printf()

Summary:
Using fprintf() allows us more control over where text is output to. This is especially relevant if we wish to change some of the output to a log file or stderr rather than the current behavior of outputting solely to stdout. It also better clarifies where the text is being output to making the code easier.

Scripted diff using
sed -i -e 's/printf(\"/fprintf(stdout,\"/g' ./seeder/*

Test Plan:

make
bitcoin-seeder

Make sure seeder is outputting something like:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
No nameserver set. Not starting DNS server.
Loading dnsseed.dat...done
Starting seeder...done
Starting 96 crawler threads...2019-10-07T23:03:47Z connect() to [2001:67c:130c:254::46]:8333 failed: Cannot assign requested address (99)
...

bitcoin-seeder -h seeder.bitframe.org -n dev.bitframe.org -p 5364 -m info@bitframe.org --testnet

This should output something like:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
Using testnet.
Loading dnsseed.dat...done
Starting 4 DNS threads for seeder.bitframe.org on dev.bitframe.org (port 5364).......done
Starting seeder...done
Starting 96 crawler threads...2019-10-07T23:06:18Z connect() to [2001:67c:130c:254::46]:8333 failed: Cannot assign requested address (99)
...

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4222

Details

Provenance
nakihitoAuthored on Oct 5 2019, 22:42
nakihitoPushed on Oct 12 2019, 19:50
Reviewer
Restricted Owners Package
Differential Revision
D4222: Update seeder files to use fprintf() instead of printf()
Parents
rABCdb003f8301e2: Merge #9598: Improve readability by removing redundant casts to same type (on…
Branches
Unknown
Tags
Unknown