X-CASH-official / xcash-core

📦 First Cryptonote coin with public & private transactions, custom DPOS consensus
https://xcash.foundation
Other
66 stars 20 forks source link

Will the server restart address information be lost? #12

Closed tzdadada closed 4 years ago

tzdadada commented 4 years ago

Hello, may I ask, after my X-CASH Linux node generates an address, because the server restarts, I have no time to exit the node, will this part of the address be lost?

I generated some addresses before, but now using the "address all" command of "xcash-wallet-cl" on the node, I have not seen that the addresses have been generated before, and some transactions are also lost with the address. Any way to recover?

zachhildreth commented 4 years ago

Hi @tzdadada

I am pretty sure the funds would be recoverable. You are talking about creating a sub address correct (the address format starts with an 8)

These are computed from your view key, meaning as long as you have the mnemonic seed of the "XCA" wallet you should never "lose" any of the sub-address wallets, as they are reconstructed at import of the mnemonic seed.

However I am wondering if either

1 The wallet cache got corrupted

2 You have hit a limit in the wallet for sub address look aheads

do you have any estimate of how many sub addresses you might have in that wallet. I ask because if you generate 200 sub addresses, and then generate the 201th sub address, if the first 200 have a balance of 0 but the 201 has a balance of > 0, it wont show in the wallet due to a limitation.

Also are these addresses under one account, or multiple accounts. I would assume 1 account unless you know they are not under one account.

My suggestion to fix both of these at the same time, if its the problem is to set the sub address lookahead to a higher number to see if that works, followed by a rescan of the blockchain

Note it will take longer the higher the number you set, but will only take longer the first time as the cache builds

so I would try the following for the sub address look ahead in order to see if it resolves the problem. You should probably try this out on your home computer if you can instead of the server, since this command takes a while on a less powerful computer.

Login to the wallet using the xcash-wallet-cli, then run this command set subaddress-lookahead 1:20000

Then rescan the blockchain rescan_bc

If this did not work try this instead

Login to the wallet using the xcash-wallet-cli, then run this command (note this will take a lot longer) set subaddress-lookahead 100:50000

Then rescan the blockchain rescan_bc

and let me know if it shows all of the sub addresses and your balance.

here is the link to our documentation for the CLI wallet as well https://docs.xcash.foundation/documentation/xcash-wallet-cli

tzdadada commented 4 years ago

I tried using the "set subaddress-lookahead 100: 50000", "rescan_bc" command, and it worked! My balance is displayed normally

details as following:

[wallet XCA1SM]: set subaddress-lookahead 100:50000
Wallet password: 
[wallet XCA1SM]: rescan_bc
Warning: this will lose any information which can not be recovered from the blockchain.
This includes destination addresses, tx secret keys, tx notes, etc
Rescan anyway ? (Y/Yes/N/No): y
Starting refresh...
Enter password (output received): 
Height 511322, txid <dcfae07d811e2c4a512de323fd4cf97258e57d4d955eccfb5b3b48f46899dc6d>, 73763.422000, idx 0/0
Height 514799, txid <f17723e9e8c3298fca63ee2337a3de8229069bfbc1ac257d6d185df29119ac39>, 1.279520, idx 0/0
Height 514799, txid <f17723e9e8c3298fca63ee2337a3de8229069bfbc1ac257d6d185df29119ac39>, 73761.422000, idx 0/2
Height 514799, txid <f17723e9e8c3298fca63ee2337a3de8229069bfbc1ac257d6d185df29119ac39>, spent 73763.422000, idx 0/0
Height 515472, txid <f76f09cbb0db0e43b0ca328ca4785d0949a9f166b7e32711831056c35cb2b721>, 0.502330, idx 0/0
Height 515472, txid <f76f09cbb0db0e43b0ca328ca4785d0949a9f166b7e32711831056c35cb2b721>, spent 1.279520, idx 0/0
Height 515592, txid <0fd3557d7ff29fc6b7a873e9450a50cc40201c89ad96bed658f522eb7d2f2170>, 18760.701520, idx 0/0
Height 515592, txid <0fd3557d7ff29fc6b7a873e9450a50cc40201c89ad96bed658f522eb7d2f2170>, spent 73761.422000, idx 0/2
Height 515603, txid <f6de2889c23251331892219063aee185c77a265db616550e13396ba0c4fa1102>, 760.057010, idx 0/0
Height 515603, txid <f6de2889c23251331892219063aee185c77a265db616550e13396ba0c4fa1102>, spent 18760.701520, idx 0/0
Height 515603, txid <f6de2889c23251331892219063aee185c77a265db616550e13396ba0c4fa1102>, spent 0.502330, idx 0/0
Height 516197, txid <07df29b84e68530840a4c8d838d96df5b1c463d16cc418e3a540c5da7158e69b>, 72990.000000, idx 0/3
Height 516324, txid <0dc30a3193b347c4b332e6eba717f6c4267576023d6dafc0daedfca8ceaca8db>, 62989.281196, idx 0/0
Height 516324, txid <0dc30a3193b347c4b332e6eba717f6c4267576023d6dafc0daedfca8ceaca8db>, spent 72990.000000, idx 0/3
Height 516341, txid <6504c55fed6af57fe0a1755a5fbc9822d44dce505e0918447df39f56c4d62d9c>, 53748.195106, idx 0/0
Height 516341, txid <6504c55fed6af57fe0a1755a5fbc9822d44dce505e0918447df39f56c4d62d9c>, spent 760.057010, idx 0/0
Height 516341, txid <6504c55fed6af57fe0a1755a5fbc9822d44dce505e0918447df39f56c4d62d9c>, spent 62989.281196, idx 0/0
Height 516399, txid <d2c6924abeab8ba727c64990a5c9c99dae927770c4432da5de146ec6cae00086>, 43747.475734, idx 0/0
Height 516399, txid <d2c6924abeab8ba727c64990a5c9c99dae927770c4432da5de146ec6cae00086>, spent 53748.195106, idx 0/0
Height 516416, txid <f290cbfb8a734a1feb7c533a243ff239869bbb8379dafe23122b91198fefb9c7>, 15746.755226, idx 0/0
Height 516416, txid <f290cbfb8a734a1feb7c533a243ff239869bbb8379dafe23122b91198fefb9c7>, spent 43747.475734, idx 0/0
Height 516919, txid <4686f21c818ec50a530272f5935e04753b25f5df308b353c40abad44f2391099>, 57990.055000, idx 0/11
Height 517043, txid <5671565ab8b21d0f93802425471ef4d6b2f87d4da90a7e35787c8e78d23a3b88>, 37999.334776, idx 0/0
Height 517043, txid <5671565ab8b21d0f93802425471ef4d6b2f87d4da90a7e35787c8e78d23a3b88>, spent 57990.055000, idx 0/11
Height 517090, txid <879feae8aa757bb46ba67112797c43e45754b52e487d13fb4007a92d35728fa4>, 43754.949742, idx 0/0
Height 517090, txid <879feae8aa757bb46ba67112797c43e45754b52e487d13fb4007a92d35728fa4>, spent 37999.334776, idx 0/0
Height 517090, txid <879feae8aa757bb46ba67112797c43e45754b52e487d13fb4007a92d35728fa4>, spent 15746.755226, idx 0/0
Height 517103, txid <3a9464ff43b12ee7dd005bfb3871d160bd4fbef2c1a03048871ae299dbc84834>, 33764.229802, idx 0/0
Height 517103, txid <3a9464ff43b12ee7dd005bfb3871d160bd4fbef2c1a03048871ae299dbc84834>, spent 43754.949742, idx 0/0
Height 517119, txid <0e35008d7dc7eb503384778747473cb619d35eac8285a39a68dd75321500d3d1>, 28763.500998, idx 0/0
Height 517119, txid <0e35008d7dc7eb503384778747473cb619d35eac8285a39a68dd75321500d3d1>, spent 33764.229802, idx 0/0
Height 517137, txid <24e72eab99d7457a6c8261e630cbacaee5848e4f8a6949213607280075807bcf>, 3772.749518, idx 0/0
Height 517137, txid <24e72eab99d7457a6c8261e630cbacaee5848e4f8a6949213607280075807bcf>, spent 28763.500998, idx 0/0
Height 517836, txid <e0c0ede82944119a4b75a4ae900625435efca620555c9a21e4220ef367fddad5>, 69950.042108, idx 0/653
Height 519054, txid <a3c9d7684ee574bb98e12b64f768419e5c4576aa0c0adc07d7a046fa623c0e18>, 50000.000000, idx 0/557
Height 519066, txid <11abb37b6603812e2c751003bc272a7caa4bea3b1e9c55799a7206c3eae4a96d>, 4879928.414000, idx 0/657
Height 519164, txid <e34b207b47819b118f8ca300d7eb82ffbd19956aa74053a8a22e87ecb872f73b>, 18569950.980000, idx 0/557
Height 522067, txid <7abef6d60f413fc20990d5df82db7aec79b38d9ca548a1bfd7dbbcbc92305546>, 4311675.000000, idx 0/653
Refresh done, blocks received: 13083                            
Currently selected account: [0] Primary account
Tag: (No tag assigned)
Balance: 27885277.185626, unlocked balance: 27885277.185626
[wallet XCA1SM]: balance
Currently selected account: [0] Primary account
Tag: (No tag assigned)
Balance: 27885277.185626, unlocked balance: 27885277.185626

thank you very much for your help XDXDXDXDXD

zachhildreth commented 4 years ago

@tzdadada I am very glad we could resolve the issue and recover the funds!

Closing this issue now.