<p>The account system has been deprecated and removed, and is no longer available in Bitcoin 0.18.1. As it has been removed, previous account information is also no longer available.</p>

<p>You should transition to the new multiwallet system, or track accounts externally.</p>

CC BY-SA 4.0
2019-09-01T02:46:24.753Z
I assume that the db upgrade is not backwards compatible, although it is possible there's no real "upgrade", and the old information is still present in the wallet.dat, and a downgrade would be able to process it again. I would backup the wallet file before attempting that, though. You can look at [this](https://bitcoin.stackexchange.com/a/74030/7272) for a brief intro to using the multiwallet system. Beyond that, the RPC documentation is pretty thorough
Raghav Sood
CC BY-SA 4.0
2019-09-01T00:37:13.387Z
2019-09-01T00:37:13.387Z
Raghav Sood
<p>My app uses a cron blocknotify-update-deposit to search for incoming deposits, users deposit funds and they are then added to their balances. </p>

<p>I have not used my app for around six months and I have changed nothing other than upgrade to bitcoin core 18.1 after creating several new accounts today and testing deposits they don't appear to be working.</p>

<p>I have changed no code I have logged the error showing in the deposit log and provided the code here.</p>

<p>Can anyone help me solve this it's driving me crazy.</p>

<p>The deposit code.</p>

<pre><code>&lt;?php
namespace App\Http\Controllers;

use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Log;
use App\Models\Setting;
use App\Models\Wallet;
use App\Models\Deposit;
use App\Models\Balance;
use App\Models\AddressDeposit;
use App\User;

class DepositController extends BaseController {    

    public function blocknotifyUpdateDeposit(){
        $blockhash = isset($_GET['trxhash'])? $_GET['trxhash']:0; 
        $logFile = 'laravel_notify_deposit.log';
        //Log::useDailyFiles(storage_path().'/logs/callbackdeposits/'.$logFile);
        Log::info("*******New Blocknotify Update Deposit: ".$blockhash);

        $setting = new Setting();
        $wallet = Wallet::where('type','=','BTC')-&gt;first();
        $wallet-&gt;connectJsonRPCclient();
        $limit_confirmations=$setting-&gt;getSetting('num_confirmations_deposit',2);
        $listtrans = $wallet-&gt;getListTransactions();            
        @Log::info("\n".'Result listtrans: ',$listtrans);            
        $balance=new Balance();
        foreach ($listtrans as $key =&gt; $value) {
            try{
                $transaction_id = $value['txid'];
                $trans = $wallet-&gt;getTransaction($transaction_id);                        
                if($trans != null) {
                    foreach ($trans["details"] as $key =&gt; $detail) {
                        Log::info( "\n"."transaction detail: ",$detail);
                        $account = $detail["account"];
                        $category = $detail["category"];//send,receive
                        $confirms = $trans["confirmations"];
                        $address_ = $detail["address"];
                        $amount = $detail["amount"];
                        Log::info( "\n"."------Account: ".$account." -- category:".$category." --address: ".$address_);
                        $deposit = Deposit::where('transaction_id', $transaction_id)-&gt;first();
                        //$user = User::where('username', $account)-&gt;first();
                        $user_address_deposit = AddressDeposit::where('address',$address_)-&gt;first();
                        if(isset($user_address_deposit-&gt;user_id)){
                            $user = User::where('id', $user_address_deposit-&gt;user_id)-&gt;first();
                            if(isset($deposit-&gt;transaction_id)){                            
                                if($deposit-&gt;paid == 0){
                                    if($category == "receive" &amp;&amp; $confirms &gt;= $limit_confirmations &amp;&amp; isset($user-&gt;id))
                                    {                                
                                        Deposit::where('id',$deposit-&gt;id)-&gt;update(array('paid' =&gt; 1,'confirmations'=&gt;$confirms));
                                        $balance-&gt;addMoney($amount,$user-&gt;id);                                    
                                        Log::info( "\n".$amount." ".$wallet-&gt;type." was credited to your account");
                                    }
                                }else{
                                    Deposit::where('id',$deposit-&gt;id)-&gt;update(array('confirmations'=&gt;$confirms));
                                    Log::info( "\n".$amount." ".$wallet-&gt;type." was already credited to your account. contact support if you need further assistance.");
                                }
                            }else{
                                if($category == "receive" &amp;&amp; isset($user-&gt;id)) {
                                    if($confirms &gt;= $limit_confirmations) {
                                        $depositOb=new Deposit();
                                        $depositOb-&gt;user_id=$user-&gt;id;
                                        $depositOb-&gt;transaction_id=$transaction_id;
                                        $depositOb-&gt;fee_deposit=0;
                                        $depositOb-&gt;amount=$amount;
                                        $depositOb-&gt;paid=1;
                                        $depositOb-&gt;confirmations=$confirms;
                                        $depositOb-&gt;address=$address_;
                                        $depositOb-&gt;created_at=date('Y-m-d H:i:s');
                                        $depositOb-&gt;updated_at=date('Y-m-d H:i:s');
                                        $depositOb-&gt;save();

                                        $balance-&gt;addMoney($amount,$user-&gt;id);                                    
                                        Log::info( "\n".$amount." ".$wallet-&gt;type." was credited to your account");
                                    }else{
                                        $depositOb=new Deposit();
                                        $depositOb-&gt;user_id=$user-&gt;id;
                                        $depositOb-&gt;transaction_id=$transaction_id;
                                        $depositOb-&gt;amount=$amount;
                                        $depositOb-&gt;paid=0;
                                        $depositOb-&gt;confirmations=$confirms;
                                        $depositOb-&gt;fee_deposit=0;

                                        $depositOb-&gt;address=$address_;
                                        $depositOb-&gt;created_at=date('Y-m-d H:i:s');
                                        $depositOb-&gt;updated_at=date('Y-m-d H:i:s');
                                        $depositOb-&gt;save();

                                        Log::info( "\n"."This Deposit is unconfirmed. Current confirmations:" . $confirms .". Required : 3.");
                                    }
                                }else{                                
                                    Log::info( "\n"."transaction is not a deposit or account is invalid.");
                                }
                            }
                        }else{
                            Log::info("\n"."Can not find user for address: ".$address_.".");
                        }
                    }                    
                }else{  
                    Log::info("\n"."We can't find any information about this deposit. contact support.");               
                }//trans
            }catch (\Exception $e) {
                Log::info('Caught exception: '.$e-&gt;getMessage()."\n");
            }
        }

        Log::info("*******Stop New Blocknotify Update Deposit*************"); 
    }    
}
</code></pre>

<p>My error log</p>

<pre><code>[2019-08-31 17:35:01] local.INFO:
transaction detail:  {"address":"37evB6raGttBxDEyMNzosS6wHbKuQrCob5","category":"receive","amount":0.014,"label":"newaccount3","vout":1}
[2019-08-31 17:35:01] local.INFO: Caught exception: Undefined index: account

[2019-08-31 17:35:01] local.INFO:
transaction detail:  {"address":"38pcypeGRgjeMWrRBQnoqBkM4YE75ubANh","category":"receive","amount":0.0018,"label":"newaccount4","vout":0}
[2019-08-31 17:35:01] local.INFO: Caught exception: Undefined index: account
</code></pre>

<p>If you need it here is the balance code from the balancecontroller</p>

<pre><code>    $user = \Auth::user();
        $addr_deposit = AddressDeposit::where('user_id',$user-&gt;id)-&gt;where('used',0)-&gt;first();       
        $address=''; 
        $wallet = Wallet::where('type','=','BTC')-&gt;first();
        if(!isset($addr_deposit-&gt;address)) {
            try{
                $wallet-&gt;connectJsonRPCclient();                
                $address = $wallet-&gt;getNewDepositReceiveAddress($user-&gt;username);
                AddressDeposit::insert(array('user_id' =&gt; $user-&gt;id,'address'=&gt;$address, 'used'=&gt;0));
            }catch (\Exception $e) {
                $data['error_message']= "Can not connect to wallet"; //'Caught exception: '.$e-&gt;getMessage()."\n"; //                
            }
        }else 
        $address = $addr_deposit-&gt;address; 

        $balance = new Balance();
        $balance_amount = $balance-&gt;getBalance();
</code></pre>

CC BY-SA 4.0
2019-09-02T09:58:42.397Z
Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the [CC BY-SA 3.0 license](https://creativecommons.org/licenses/by-sa/3.0) for SE to distribute that content. By SE policy, any vandalism will be reverted. If you want to know more about deleting a post, consider taking a look at: [How does deleting work](https://meta.stackexchange.com/q/5221/295232)?
Glorfindel
<bitcoin-core>
Bitcoin deposit function suddenly stopped working
MoneroHelpme
# Bitcoin deposit function suddenly stopped working

(Asked by: username_0 on 2019-08-31)

My app uses a cron blocknotify-update-deposit to search for incoming deposits, users deposit funds and they are then added to their balances.

I have not used my app for around six months and I have changed nothing other than upgrade to bitcoin core 18.1 after creating several new accounts today and testing deposits they don't appear to be working.

I have changed no code I have logged the error showing in the deposit log and provided the code here.

Can anyone help me solve this it's driving me crazy.

The deposit code.

```
<?php
namespace App\Http\Controllers;

use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Log;
use App\Models\Setting;
use App\Models\Wallet;
use App\Models\Deposit;
use App\Models\Balance;
use App\Models\AddressDeposit;
use App\User;

class DepositController extends BaseController {    

    public function blocknotifyUpdateDeposit(){
        $blockhash = isset($_GET['trxhash'])? $_GET['trxhash']:0; 
        $logFile = 'laravel_notify_deposit.log';
        //Log::useDailyFiles(storage_path().'/logs/callbackdeposits/'.$logFile);
        Log::info("*******New Blocknotify Update Deposit: ".$blockhash);

        $setting = new Setting();
        $wallet = Wallet::where('type','=','BTC')->first();
        $wallet->connectJsonRPCclient();
        $limit_confirmations=$setting->getSetting('num_confirmations_deposit',2);
        $listtrans = $wallet->getListTransactions();            
        @Log::info("\n".'Result listtrans: ',$listtrans);            
        $balance=new Balance();
        foreach ($listtrans as $key => $value) {
            try{
                $transaction_id = $value['txid'];
                $trans = $wallet->getTransaction($transaction_id);                        
                if($trans != null) {
                    foreach ($trans["details"] as $key => $detail) {
                        Log::info( "\n"."transaction detail: ",$detail);
                        $account = $detail["account"];
                        $category = $detail["category"];//send,receive
                        $confirms = $trans["confirmations"];
                        $address_ = $detail["address"];
                        $amount = $detail["amount"];
                        Log::info( "\n"."------Account: ".$account." -- category:".$category." --address: ".$address_);
                        $deposit = Deposit::where('transaction_id', $transaction_id)->first();
                        //$user = User::where('username', $account)->first();
                        $user_address_deposit = AddressDeposit::where('address',$address_)->first();
                        if(isset($user_address_deposit->user_id)){
                            $user = User::where('id', $user_address_deposit->user_id)->first();
                            if(isset($deposit->transaction_id)){                            
                                if($deposit->paid == 0){
                                    if($category == "receive" && $confirms >= $limit_confirmations && isset($user->id))
                                    {                                
                                        Deposit::where('id',$deposit->id)->update(array('paid' => 1,'confirmations'=>$confirms));
                                        $balance->addMoney($amount,$user->id);                                    
                                        Log::info( "\n".$amount." ".$wallet->type." was credited to your account");
                                    }
                                }else{
                                    Deposit::where('id',$deposit->id)->update(array('confirmations'=>$confirms));
                                    Log::info( "\n".$amount." ".$wallet->type." was already credited to your account. contact support if you need further assistance.");
                                }
                            }else{
                                if($category == "receive" && isset($user->id)) {
                                    if($confirms >= $limit_confirmations) {
                                        $depositOb=new Deposit();
                                        $depositOb->user_id=$user->id;
                                        $depositOb->transaction_id=$transaction_id;
                                        $depositOb->fee_deposit=0;
                                        $depositOb->amount=$amount;
                                        $depositOb->paid=1;
                                        $depositOb->confirmations=$confirms;
                                        $depositOb->address=$address_;
                                        $depositOb->created_at=date('Y-m-d H:i:s');
                                        $depositOb->updated_at=date('Y-m-d H:i:s');
                                        $depositOb->save();

                                        $balance->addMoney($amount,$user->id);                                    
                                        Log::info( "\n".$amount." ".$wallet->type." was credited to your account");
                                    }else{
                                        $depositOb=new Deposit();
                                        $depositOb->user_id=$user->id;
                                        $depositOb->transaction_id=$transaction_id;
                                        $depositOb->amount=$amount;
                                        $depositOb->paid=0;
                                        $depositOb->confirmations=$confirms;
                                        $depositOb->fee_deposit=0;

                                        $depositOb->address=$address_;
                                        $depositOb->created_at=date('Y-m-d H:i:s');
                                        $depositOb->updated_at=date('Y-m-d H:i:s');
                                        $depositOb->save();

                                        Log::info( "\n"."This Deposit is unconfirmed. Current confirmations:" . $confirms .". Required : 3.");
                                    }
                                }else{                                
                                    Log::info( "\n"."transaction is not a deposit or account is invalid.");
                                }
                            }
                        }else{
                            Log::info("\n"."Can not find user for address: ".$address_.".");
                        }
                    }                    
                }else{  
                    Log::info("\n"."We can't find any information about this deposit. contact support.");               
                }//trans
            }catch (\Exception $e) {
                Log::info('Caught exception: '.$e->getMessage()."\n");
            }
        }

        Log::info("*******Stop New Blocknotify Update Deposit*************"); 
    }    
}

```

My error log

```
[2019-08-31 17:35:01] local.INFO:
transaction detail:  {"address":"37evB6raGttBxDEyMNzosS6wHbKuQrCob5","category":"receive","amount":0.014,"label":"newaccount3","vout":1}
[2019-08-31 17:35:01] local.INFO: Caught exception: Undefined index: account

[2019-08-31 17:35:01] local.INFO:
transaction detail:  {"address":"38pcypeGRgjeMWrRBQnoqBkM4YE75ubANh","category":"receive","amount":0.0018,"label":"newaccount4","vout":0}
[2019-08-31 17:35:01] local.INFO: Caught exception: Undefined index: account

```

If you need it here is the balance code from the balancecontroller

```
    $user = \Auth::user();
        $addr_deposit = AddressDeposit::where('user_id',$user->id)->where('used',0)->first();       
        $address=''; 
        $wallet = Wallet::where('type','=','BTC')->first();
        if(!isset($addr_deposit->address)) {
            try{
                $wallet->connectJsonRPCclient();                
                $address = $wallet->getNewDepositReceiveAddress($user->username);
                AddressDeposit::insert(array('user_id' => $user->id,'address'=>$address, 'used'=>0));
            }catch (\Exception $e) {
                $data['error_message']= "Can not connect to wallet"; //'Caught exception: '.$e->getMessage()."\n"; //                
            }
        }else 
        $address = $addr_deposit->address; 

        $balance = new Balance();
        $balance_amount = $balance->getBalance();

```

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the [CC BY-SA 3.0 license](https://creativecommons.org/licenses/by-sa/3.0) for SE to distribute that content. By SE policy, any vandalism will be reverted. If you want to know more about deleting a post, consider taking a look at: [How does deleting work](https://meta.stackexchange.com/q/5221/295232)?  

---

## 1 answers

### Answer by username_2 on 2019-09-01. Score: 2

The account system has been deprecated and removed, and is no longer available in Bitcoin 0.18.1. As it has been removed, previous account information is also no longer available.

You should transition to the new multiwallet system, or track accounts externally.

> **Comments:**
> **username_2**: I assume that the db upgrade is not backwards compatible, although it is possible there's no real "upgrade", and the old information is still present in the wallet.dat, and a downgrade would be able to process it again. I would backup the wallet file before attempting that, though. You can look at [this](https://bitcoin.stackexchange.com/a/74030/7272) for a brief intro to using the multiwallet system. Beyond that, the RPC documentation is pretty thorough  

---

