<p>The field corresponds to false for mainnet, true for testnet, and false for regtest. You can think of it as a flag that tells you whether the current network is testnet.</p>
<h3>Why's it named like that?</h3>
<p>To get people to not use it, and because <code>getinfo</code> and <code>getmininginfo</code> still use it:</p>
<blockquote>
<p>jtimon commented:</p>
<p>Yeah, comparing to the testnet id was very readable so it's the new flag. The difference is that when people see &quot;NetworkID() == something&quot; they think they can use that too, while FlagWithLongNameIncludingTheWordDeprecated() is not as likely to be used or that's my hope.
@laanwj explained the deprecation thing, but basically, RPCs can just use bip70's networkidstring()
For the string, I was going to create another flag but @laanwj wants to keep chainparams clean of GUI-related things. Of course comparing to an enumerator is better than comparing to a string, again, the goal is that people don't see the comparation to the enumeration and think they can call CChainParams::NetworkID(), hopefully the comparison with a string will make people use that approach less, but we need the string for BIP70 anyway.</p>
</blockquote>
<p><a href="https://github.com/bitcoin/bitcoin/pull/4802#issuecomment-54269146" rel="nofollow noreferrer">(Source.)</a></p>

CC BY-SA 3.0
2015-10-22T06:38:56.283Z
2015-10-22T21:11:15.413Z
2020-06-16T11:10:03.350Z
Nick ODell
<p><code>fTestnetToBeDeprecatedFieldRPC</code> is a <code>bool</code> type variable set to some values in the <code>main</code>, <code>testnet</code> and <code>regtest</code>in <code>chainparams.cpp</code>. What is the use of this value ?</p>

<bitcoind>
What is fTestnetToBeDeprecatedFieldRPC seen in chainparams.cpp?
bawejakunal
# What is fTestnetToBeDeprecatedFieldRPC seen in chainparams.cpp?

(Asked by: username_0 on 2015-10-22)

`fTestnetToBeDeprecatedFieldRPC` is a `bool` type variable set to some values in the `main`, `testnet` and `regtest`in `chainparams.cpp`. What is the use of this value ?

**Tags:** bitcoind


---

## 1 answers

### Answer by username_1 on 2015-10-22. Score: 2

The field corresponds to false for mainnet, true for testnet, and false for regtest. You can think of it as a flag that tells you whether the current network is testnet.

### Why's it named like that?

To get people to not use it, and because `getinfo` and `getmininginfo` still use it:

> jtimon commented:
>
> Yeah, comparing to the testnet id was very readable so it's the new flag. The difference is that when people see "NetworkID() == something" they think they can use that too, while FlagWithLongNameIncludingTheWordDeprecated() is not as likely to be used or that's my hope.
> @laanwj explained the deprecation thing, but basically, RPCs can just use bip70's networkidstring()
> For the string, I was going to create another flag but @laanwj wants to keep chainparams clean of GUI-related things. Of course comparing to an enumerator is better than comparing to a string, again, the goal is that people don't see the comparation to the enumeration and think they can call CChainParams::NetworkID(), hopefully the comparison with a string will make people use that approach less, but we need the string for BIP70 anyway.

[(Source.)](https://github.com/bitcoin/bitcoin/pull/4802#issuecomment-54269146)


---

