# Lost 5k grins because of a bug? T4

**URL:** <https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109>\
**Category:** Tech Support\
**Created:** [October 31, 2018, 5:24pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109 "2018-10-31T17:24:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://forum.grin.mw/u/Arthur)\
**Post date:** [October 31, 2018, 5:24pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/1 "2018-10-31T17:24:15Z")

</div>

I believe that I could possibly have lost around 5k grins because of a bug in the test net.

Yesterday I was messing around with grin commands and trying all different things, when I’ve realized that after canceling a transaction, my locked funds didn’t return to my wallet and were gone forever.

Here is my current wallet txs and wallet info, 12 hours after the bug:  
[https://pastebin.com/QBARnzpR](https://pastebin.com/QBARnzpR) (I believe the bug happened at transaction 178 - line 364 of the pastebin)

And here is all the grin commands I’ve run in the session that the bug occurred:  
[https://pastebin.com/69Ge0Pbe](https://pastebin.com/69Ge0Pbe) (Bug happened after line 743)

Another thing I’ve noticed, is that yesterday some transactions I’ve tried to make returned this error, even though I had more than enough “currently spendable” grins in my wallet:

````
```
grin wallet send -d "http://108.196.200.233:13415" 20.0
2018-10-31T00:23:43.983935175-03:00 WARN grin - Using wallet configuration file at /home/arthur/.grin/grin-wallet.toml
2018-10-31T00:23:46.214033101-03:00 ERROR grin::cmd::wallet - Tx not created: Error { inner: 

Not enough funds. Required: 20005000000, Available: 0 }
```

````

This last behaviour occurred in line 73,119,170 and 214 of the above pastebin.

Have anyone ever experienced anything like this?

---

<div class="post-metadata">

**Author:** ![quentinlesceller](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/quentinlesceller/32/21_2.png) [@quentinlesceller](https://forum.grin.mw/u/quentinlesceller)\
**Post date:** [October 31, 2018, 11:27pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/2 "2018-10-31T23:27:18Z")

</div>

Hey Arthur,

Thanks for letting us know. Could you post this message on Github (simply create an issue) so we can investigate this further?

Thanks

---

<div class="post-metadata">

**Author:** ![lehnberg](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/lehnberg/32/159_2.png) [@lehnberg](https://forum.grin.mw/u/lehnberg)\
**Post date:** [November 1, 2018, 1:11pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/3 "2018-11-01T13:11:55Z")

</div>

Filed [https://github.com/mimblewimble/grin/issues/1909](https://github.com/mimblewimble/grin/issues/1909) just so we don’t lose this.

---

<div class="post-metadata">

**Author:** ![hashmap](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@hashmap](https://forum.grin.mw/u/hashmap)\
**Post date:** [November 1, 2018, 2:13pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/4 "2018-11-01T14:13:56Z")

</div>

It happened to me, after cancelling a tx and some additional operations my balance was quite off. But in my case I was running a malfunctioning (for unrelated test purpose) version of grin so I decided it was my fault. I restored my balance with `grin wallet restore`.

---

<div class="post-metadata">

**Author:** ![lehnberg](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/lehnberg/32/159_2.png) [@lehnberg](https://forum.grin.mw/u/lehnberg)\
**Post date:** [November 1, 2018, 2:24pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/5 "2018-11-01T14:24:40Z")

</div>

@Arthur can you advise whether `grin wallet restore` fixes the issue?

---

<div class="post-metadata">

**Author:** ![dean0h](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@dean0h](https://forum.grin.mw/u/dean0h)\
**Post date:** [November 1, 2018, 6:54pm UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/6 "2018-11-01T18:54:47Z")

</div>

I’m not 100% sure but I’m almost certain something similar happened to me. I was only mining and besides that don’t think I touched anything else.  
I checked my wallet balance (as I do a couple times a day) and it appeared lower from what I remembered the previous time checking it. I very briefly checked in some logs but didn’t find anything.  
Also, the timing for both of us lines up. This was recent.

---

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://forum.grin.mw/u/Arthur)\
**Post date:** [November 2, 2018, 1:53am UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/7 "2018-11-02T01:53:38Z")

</div>

@lehnberg I’ve renamed my current db directory as “db\_backup” and left the seed file untouched. After running `grin wallet restore` my total account balance was 0, compared to 1960 before. I don’t know if I did it right though.

I could send my seed file or any needed file to facilitate the investigation.

---

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://forum.grin.mw/u/Arthur)\
**Post date:** [November 2, 2018, 2:56am UTC](https://forum.grin.mw/t/lost-5k-grins-because-of-a-bug-t4/1109/8 "2018-11-02T02:56:16Z")

</div>

I think I’ve managed to replicate the bug, I’ve posted some information in the github issue.
