# Coins lost after -rescan

**URL:** <https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530>\
**Category:** General\
**Created:** [May 17, 2019, 3:35pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530 "2019-05-17T15:35:49Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 17, 2019, 3:35pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/1 "2019-05-17T15:35:49Z")

</div>

Hi, guys.

My coins are lost after I restarted zcash daemon with -rescan (did it because  
I was getting `bad-txns-joinsplit-requirements-not-met` error).

After -rescan, that error disappeared and I’ve successfully transfered 0.9 ZEC from my t-addr to  
my z-addr. However, after I did this, the bigger part of z-addr coins are lost.

This is the log of my interactions with zcash client (Ubuntu):

```auto
david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf getbalance
1.01648388
david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_gettotalbalance
{
  "transparent": "1.01648388",
  "private": "21.6898",
  "total": "22.70628388"
}
david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_listaddresses
[
  "zs1n..."
]
david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf listaddressgroupings
[
  [
    [
      "t1Q...",
      0.00000000,
      ""
    ],
    [
      "t1W...",
      1.01648388
    ]
  ]
]

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_sendmany "zs1n..." "[{\"amount\": 0.9, \"address\": \"t1Q...\"}]"
opid-88a2f681-673d-409c-bd21-9f875e353533

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_getoperationresult
[
  {
    "id": "opid-88a2f681-673d-409c-bd21-9f875e353533",
    "status": "failed",
    "creation_time": 1558094711,
    "error": {
      "code": -26,
      "message": "tx-expiring-soon: expiryheight is 534110 but should be at least 534115 to avoid transaction expiring soon"
    },
    "method": "z_sendmany",
    "params": {
      "fromaddress": "zs1n...",
      "amounts": [
        {
          "amount": 0.9,
          "address": "t1Q..."
        }
      ],
      "minconf": 1,
      "fee": 0.0001
    }
  }
]

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_sendmany "zs1n..." "[{\"amount\": 0.9, \"address\": \"t1Q...\"}]"
opid-2d619634-8ed3-4917-a990-1995769657f5

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_getoperationresult
[
  {
    "id": "opid-2d619634-8ed3-4917-a990-1995769657f5",
    "status": "failed",
    "creation_time": 1558095034,
    "error": {
      "code": -26,
      "message": "18: bad-txns-joinsplit-requirements-not-met"
    },
    "method": "z_sendmany",
    "params": {
      "fromaddress": "zs1n...",
      "amounts": [
        {
          "amount": 0.9,
          "address": "t1Q..."
        }
      ],
      "minconf": 1,
      "fee": 0.0001
    }
  }
]

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_sendmany "zs1n..." "[{\"amount\": 0.9, \"address\": \"t1d... \"}]"
opid-36217a38-62c5-47bc-87b3-7afefdd087d7

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_getoperationresult
[
  {
    "id": "opid-36217a38-62c5-47bc-87b3-7afefdd087d7",
    "status": "failed",
    "creation_time": 1558095240,
    "error": {
      "code": -26,
      "message": "18: bad-txns-joinsplit-requirements-not-met"
    },
    "method": "z_sendmany",
    "params": {
      "fromaddress": "zs1n...",
      "amounts": [
        {
          "amount": 0.9,
          "address": "t1d... "
        }
      ],
      "minconf": 1,
      "fee": 0.0001
    }
  }
]

------------------------------------------------------------------------------------------
(restarting daemon with -rescan)
------------------------------------------------------------------------------------------

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_sendmany "zs1n..." "[{\"amount\": 0.9, \"address\": \"t1d... \"}]"
opid-bbb76108-e6d3-4fa4-a7d7-14797a464726

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_getoperationresult
[
  {
    "id": "opid-bbb76108-e6d3-4fa4-a7d7-14797a464726",
    "status": "success",
    "creation_time": 1558097086,
    "result": {
      "txid": "082813ff5dbb8ad4a003c59b2b2758f82e6da6b8f0dbae810cb3dade9b6e7ad2"
    },
    "execution_secs": 12.524275122,
    "method": "z_sendmany",
    "params": {
      "fromaddress": "zs1n...",
      "amounts": [
        {
          "amount": 0.9,
          "address": "t1d... "
        }
      ],
      "minconf": 1,
      "fee": 0.0001
    }
  }
]
david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_gettotalbalance
{
  "transparent": "1.01648388",
  "private": "0.0099",
  "total": "1.02638388"
}

------------------------------------------------------------------------------------------
(I hour later, it's still 4.2597 private coins, where is the rest?)
------------------------------------------------------------------------------------------

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_gettotalbalance
{
  "transparent": "1.01648388",
  "private": "4.2597",
  "total": "5.27618388"
}

david@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z_gettotalbalance
{
  "transparent": "1.01648388",
  "private": "4.2597",
  "total": "5.27618388"
}
```

Edit: redacted addresses

---

<div class="post-metadata">

**Author:** ![Shawn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/shawn/32/187_2.png) [@Shawn](https://forum.zcashcommunity.com/u/Shawn)\
**Post date:** [May 17, 2019, 3:42pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/2 "2019-05-17T15:42:47Z")

</div>

When you use the -rescan it starts from block #1 and works it’s way to the current block height. You will need to let it completely catch up before it will show your funds.

Remember, depending on when you send/received funds the transactions will be recorded at different block heights. So if your node hasn’t finished the rescan completely then it will not show your whole balance.

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 17, 2019, 5:09pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/3 "2019-05-17T17:09:46Z")

</div>

Hmm… Where is the status of ‘rescanning’ is displayed? I thought it is already done as I see this:

Block height | 534229  
Connections | 8  
Network solution rate | 3720205218 Sol/s

Is it still rescanning ?

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 17, 2019, 5:20pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/4 "2019-05-17T17:20:34Z")

</div>

I did -rescan one more time, it took like a minute. Now it’s done and it’s still 4.2597 private coins, where is the restof 21.6898. I just can’t get it.

---

<div class="post-metadata">

**Author:** ![CitricAcid](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@CitricAcid](https://forum.zcashcommunity.com/u/CitricAcid)\
**Post date:** [May 17, 2019, 5:20pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/5 "2019-05-17T17:20:53Z")

</div>

Current block height is 534,234, so it does sound like you have completed the sync

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 17, 2019, 5:37pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/6 "2019-05-17T17:37:15Z")

</div>

I’ve notice there is a space character at the end of destination address. Is it ok?

```auto
"address": "t1... "

```

Edit: redacted address

---

<div class="post-metadata">

**Author:** ![paige](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/paige/32/31152_2.png) [@paige](https://forum.zcashcommunity.com/u/paige)\
**Post date:** [May 17, 2019, 6:29pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/7 "2019-05-17T18:29:48Z")

</div>

The metrics screen should say “Rescanning…” if it’s in the process of rescanning still.

Your debug.log (in the data directory) should show you the exact height it’s at as well. I would suggest you check here.

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 17, 2019, 7:59pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/8 "2019-05-17T19:59:13Z")

</div>

Guys, please, help! 1k$ lost! Tried -rescan and restoring the entire data directory from two different backups. After -rescan it sees only 4 ZEC, it should be 20 !

---

<div class="post-metadata">

**Author:** ![boxalex](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/boxalex/32/14872_2.png) [@boxalex](https://forum.zcashcommunity.com/u/boxalex)\
**Post date:** [May 17, 2019, 10:34pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/9 "2019-05-17T22:34:25Z")

</div>

Did you try the commands getprivkey and than importprivkey into the new wallet?

With a clean installation and your private keys there shouldn’t be a problem in my opinion, enough you have the private keys of course, which should be a MUST!

---

<div class="post-metadata">

**Author:** ![daira](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/daira/32/43253_2.png) [@daira](https://forum.zcashcommunity.com/u/daira)\
**Post date:** [May 19, 2019, 6:13pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/10 "2019-05-19T18:13:48Z")

</div>

The User Support team will look at this on Monday. In the meantime, what version of Zcash are you running?

---

<div class="post-metadata">

**Author:** ![paige](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/paige/32/31152_2.png) [@paige](https://forum.zcashcommunity.com/u/paige)\
**Post date:** [May 20, 2019, 6:19pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/11 "2019-05-20T18:19:48Z")

</div>

There are two more options to try:

1. do a -reindex which takes a lot longer but might work where a -rescan doesn’t
2. try exporting the key from this wallet into a separate wallet

Let us know how these options turn out.

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 26, 2019, 10:10am UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/12 "2019-05-26T10:10:53Z")

</div>

Yes, guys. I exported the keys for z-addr and wallets. Re-downloading entire blockchain. Will tell about the result.

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [May 31, 2019, 6:06am UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/13 "2019-05-31T06:06:36Z")

</div>

Please delete my personal information (t/z -addresses)  
I’m still downloading a blockchain.  
Have some clues. I was running zcash on 2GB RAM. Maybe there is a bug that destroys money in not-enough-memory cases when sending transactions.

---

<div class="post-metadata">

**Author:** ![Autotunafish](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/autotunafish/32/7827_2.png) [@Autotunafish](https://forum.zcashcommunity.com/u/Autotunafish)\
**Post date:** [May 31, 2019, 12:53pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/14 "2019-05-31T12:53:56Z")

</div>

The amount of ram required to generate a shielded transaction is 2 GB as stated on the main site whereas on readthedocs the amount required to ensure zcashd operates"gracefully" is 5 GB, this should probably be clarified : )@paige

---

<div class="post-metadata">

**Author:** ![paige](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/paige/32/31152_2.png) [@paige](https://forum.zcashcommunity.com/u/paige)\
**Post date:** [May 31, 2019, 1:16pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/15 "2019-05-31T13:16:16Z")

</div>

I redacted your addresses for you (for the future, you can edit your own posts).

Regarding the RAM situation, if the memory was maxed at any point, you should have received an out of memory error. We’re pretty confident this is not a loss of funds situation but rather the wallet not properly detecting associated notes. Lets see what your balances are once everything is synced up. Thanks for remaining patient! Spinning up a new node/reindexing is certainly tedious. 😬

---

<div class="post-metadata">

**Author:** ![mdr0id](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/mdr0id/32/37160_2.png) [@mdr0id](https://forum.zcashcommunity.com/u/mdr0id)\
**Post date:** [May 31, 2019, 2:39pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/16 "2019-05-31T14:39:04Z")

</div>

For sanity, are you running any special config options in your conf file?

I do not recommend running zcashd nodes on 2GB, as numerous issues can arise depending on your system specs. To be fair, it can be done but not without modifications to the conf and the system itself.

We use the phrase “operate gracefully” to indicate a known reference point where a zcashd full node is pinned with data indicating it can operate per some set of requirements. It is true you can generate certain transactions with 2GB, but a full node is doing quite a bit more.

I would recommend bumping this node to 4GB or 5GB of RAM and doing a full reindex. Also, please sanity check the address itself, without the use of z\_gettotalbalance.

---

<div class="post-metadata">

**Author:** ![jurokolo9928](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jurokolo9928](https://forum.zcashcommunity.com/u/jurokolo9928)\
**Post date:** [June 5, 2019, 11:20am UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/17 "2019-06-05T11:20:32Z")

</div>

I downloaded the entire blockchain.  
All commands work, but z\_importkey doesn’t:

> [@](#):
>
> limited@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf z\_importkey secret-extended-key-main1\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* yes
> 
> [5 minutes of working[
> 
> error: couldn’t connect to server: timeout reached (code 0)  
> (make sure server is running and you are connecting to the correct RPC port)
> 
> [since now, every zcash-cli commands stop responding]
> 
> limited@ubuntu:~$ zcash-cli -conf=/mnt/hgfs/zcash-data-vm/zcash.conf help
> 
> [nothing is happening]

---

<div class="post-metadata">

**Author:** ![paige](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/paige/32/31152_2.png) [@paige](https://forum.zcashcommunity.com/u/paige)\
**Post date:** [June 5, 2019, 1:06pm UTC](https://forum.zcashcommunity.com/t/coins-lost-after-rescan/33530/18 "2019-06-05T13:06:05Z")

</div>

“couldn’t connect to server” means zcashd is not running. Looks like it crashed for some reason which is a separate issue.

Can you try restarting zcashd and trying the import again?
