1

If I call getpeerinfo through RPC on one of my nodes, it gives me a list of info about my peers, including my peer's "banscore" for each of its peers.

I would like to do the reverse. Can I get my peer's ban score for my node?

Or maybe there isn't a way to do this because it would allow peers to misbehave in small ways and keep track of how close they are to getting banned.

2

Correct: there's no provision in the P2P network protocol for your peers to tell you what ban score they've computed for you.

Since each node connected to you separately computes a ban score using its own rules, there's no way for you to confidently know your ban score unless you have some sort of monitor that knows all the ban score rules for all the full nodes connected to you. (E.g. the rules for Bitcoin Core 0.9.0, 0.9.2, 0.9.3, etc...)

You could get a rough idea by running a separate Bitcoin Core full node that connects to your node using the whitelist option. With whitelisting enabled, Bitcoin Core still calculates the ban score and prints it to debug.log even though it will never disconnect because of a high ban score.

  • In addition, there's nothing that says a connected node even has to keep a banscore. Different implementations of the protocol might do security differently. – morsecoder Jan 15 '15 at 18:46
  • Correct. And there's also a command line switch for Bitcoin Core that increases the score needed to ban, and another switch to change the time a node stays banned. I believe core dev Mike Hearn strongly dislikes the ban score mechanism. I keep forgetting what he proposes as a replacement, but if you're curious, you can search around. (He mentions it in #bitcoin-dev IRC about once a month.) – David A. Harding Jan 15 '15 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.