<p>Take a look at</p>
<pre><code>/bitcoin/src/interfaces/wallet.h,
/bitcoin/src/qt/overviewpage.cpp,
/bitcoin/src/wallet/interfaces.cpp, 
/bitcoin/src/wallet/rpcwallet.cpp 

and the tests in 

/bitcoin/test/functional/wallet_basic.py,  
/bitcoin/test/functional/wallet_multiwallet.py  
</code></pre>
<p>wallet.h</p>
<pre><code>//! Collection of wallet balances.
struct WalletBalances
{
    CAmount balance = 0;
    CAmount unconfirmed_balance = 0;
    CAmount immature_balance = 0;
    bool have_watch_only = false;
    CAmount watch_only_balance = 0;
    CAmount unconfirmed_watch_only_balance = 0;
    CAmount immature_watch_only_balance = 0;

    bool balanceChanged(const WalletBalances&amp; prev) const
    {
        return balance != prev.balance || 
               unconfirmed_balance != prev.unconfirmed_balance ||
               immature_balance != prev.immature_balance ||
               watch_only_balance != prev.watch_only_balance ||
               unconfirmed_watch_only_balance != prev.unconfirmed_watch_only_balance ||
               immature_watch_only_balance != prev.immature_watch_only_balance;
    }
};
</code></pre>
<p>please note a couple deprecated calls in rpcwallet.cpp</p>
<pre><code>static RPCHelpMan getwalletinfo()
{
    return RPCHelpMan{&quot;getwalletinfo&quot;,
                &quot;Returns an object containing various wallet state info.\n&quot;,
                {},
                RPCResult{
                    RPCResult::Type::OBJ, &quot;&quot;, &quot;&quot;,
                    {
                        {
                        {RPCResult::Type::STR, &quot;walletname&quot;, &quot;the wallet name&quot;},
                        {RPCResult::Type::NUM, &quot;walletversion&quot;, &quot;the wallet version&quot;},
                        {RPCResult::Type::STR, &quot;format&quot;, &quot;the database format (bdb or sqlite)&quot;},
                        {RPCResult::Type::STR_AMOUNT, &quot;balance&quot;, &quot;DEPRECATED. Identical to getbalances().mine.trusted&quot;},
                        {RPCResult::Type::STR_AMOUNT, &quot;unconfirmed_balance&quot;, &quot;DEPRECATED. Identical to getbalances().mine.untrusted_pending&quot;},
                        {RPCResult::Type::STR_AMOUNT, &quot;immature_balance&quot;, &quot;DEPRECATED. Identical to getbalances().mine.immature&quot;},
</code></pre>
<p>please review the reduce storage section in <a href="https://bitcoin.org/en/full-node#configuration-tuning" rel="nofollow noreferrer">https://bitcoin.org/en/full-node#configuration-tuning</a> if you are running in pruned mode</p>
<p>confirm your Berkeley db built, it stores wallet data and has a couple things to look out for in the configuration (especially if you use Ubuntu or Debian)
<a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md</a>
<a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db</a></p>
<p>couple notes on Segwit
<a href="https://bitcoincore.org/en/2016/01/26/segwit-benefits/" rel="nofollow noreferrer">https://bitcoincore.org/en/2016/01/26/segwit-benefits/</a></p>

CC BY-SA 4.0
2021-08-31T13:44:39.623Z
2022-09-26T09:57:35.583Z
2022-09-26T09:57:35.583Z
Max Wiggs
<p>I am just wanting to clear up a few details of the bitcoin immature_balance.Such as how to create the immature_balance? How to increase or reduce the immature_balance? And where is the cpp file which is concerned?<br />
I can't found the cpp file which is concerned. So would you please tell me where is the cpp file in  which immature_balance function concerned? Thank you very much.
By the way , my bitcoin version is bitcoin-0.20 and it runs in segtest mode.</p>

<bitcoin-core-development>
would you please tell me where is the cpp file in which immature_balance function concerned?
jiebang
# would you please tell me where is the cpp file in which immature_balance function concerned?

(Asked by: username_0 on 2021-08-30)

I am just wanting to clear up a few details of the bitcoin immature\_balance.Such as how to create the immature\_balance? How to increase or reduce the immature\_balance? And where is the cpp file which is concerned?  
I can't found the cpp file which is concerned. So would you please tell me where is the cpp file in which immature\_balance function concerned? Thank you very much.
By the way , my bitcoin version is bitcoin-0.20 and it runs in segtest mode.

**Tags:** bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2021-08-31. Score: 1

Take a look at

```
/bitcoin/src/interfaces/wallet.h,
/bitcoin/src/qt/overviewpage.cpp,
/bitcoin/src/wallet/interfaces.cpp, 
/bitcoin/src/wallet/rpcwallet.cpp 

and the tests in 

/bitcoin/test/functional/wallet_basic.py,  
/bitcoin/test/functional/wallet_multiwallet.py  

```

wallet.h

```
//! Collection of wallet balances.
struct WalletBalances
{
    CAmount balance = 0;
    CAmount unconfirmed_balance = 0;
    CAmount immature_balance = 0;
    bool have_watch_only = false;
    CAmount watch_only_balance = 0;
    CAmount unconfirmed_watch_only_balance = 0;
    CAmount immature_watch_only_balance = 0;

    bool balanceChanged(const WalletBalances& prev) const
    {
        return balance != prev.balance || 
               unconfirmed_balance != prev.unconfirmed_balance ||
               immature_balance != prev.immature_balance ||
               watch_only_balance != prev.watch_only_balance ||
               unconfirmed_watch_only_balance != prev.unconfirmed_watch_only_balance ||
               immature_watch_only_balance != prev.immature_watch_only_balance;
    }
};

```

please note a couple deprecated calls in rpcwallet.cpp

```
static RPCHelpMan getwalletinfo()
{
    return RPCHelpMan{"getwalletinfo",
                "Returns an object containing various wallet state info.\n",
                {},
                RPCResult{
                    RPCResult::Type::OBJ, "", "",
                    {
                        {
                        {RPCResult::Type::STR, "walletname", "the wallet name"},
                        {RPCResult::Type::NUM, "walletversion", "the wallet version"},
                        {RPCResult::Type::STR, "format", "the database format (bdb or sqlite)"},
                        {RPCResult::Type::STR_AMOUNT, "balance", "DEPRECATED. Identical to getbalances().mine.trusted"},
                        {RPCResult::Type::STR_AMOUNT, "unconfirmed_balance", "DEPRECATED. Identical to getbalances().mine.untrusted_pending"},
                        {RPCResult::Type::STR_AMOUNT, "immature_balance", "DEPRECATED. Identical to getbalances().mine.immature"},

```

please review the reduce storage section in <https://bitcoin.org/en/full-node#configuration-tuning> if you are running in pruned mode

confirm your Berkeley db built, it stores wallet data and has a couple things to look out for in the configuration (especially if you use Ubuntu or Debian)
<https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md>
<https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db>

couple notes on Segwit
<https://bitcoincore.org/en/2016/01/26/segwit-benefits/>


---

