2

I would like to know if there a way('command') to know what is the max supply of bitcoin using my own node without trusting a third party.

Also if anyone could explain to me why :

bitcoin-cli gettxoutsetinfo

returns this message when written:

*error: Could not connect to the server 127.0.0.1:8332 (error code 0 - "timeout reached")
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.*

Is that bcuz I'm running behind tor? Would be great if some of you guys can expand on these 2 doubts.

Lebowski
  • 53
  • 6

1 Answers1

3

In a sense, such a command would be trusting a third party: any putative answer would be that given by whoever supplied that code to you; and it may not be trustworthy - it could tell you it was 21 million, but behind the scenes actually use, say, 42 million.

The nearest you could do would be to download the source code from a proper source and, having verified your download, check the file src/amount.h for the line static const CAmount MAX_MONEY = 21000000 * COIN; before building the software yourself. You are now more sure that your node has the proper max supply.

Alistair Mann
  • 672
  • 3
  • 13
  • Hey thanks for the reply, what you say indeed makes tons of sense having that kind answer would imply me trusting someone else. – Lebowski Jan 03 '20 at 01:03
  • 4
    That MAX_MONEY constant is actually immaterial when it comes to inflation schedule, it's just a sanity check. The actual subsidy rule is implemented in the GetBlockSubsidy function in Bitcoin Core's src/validation.cpp. – Pieter Wuille Jan 03 '20 at 12:23