greenaddress / garecovery

GreenAddress recovery tool for 2of2 and 2of3 wallets
MIT License
109 stars 53 forks source link

Crash when recovering 2of2 wallet #44

Open winchip2 opened 2 years ago

winchip2 commented 2 years ago

Ran garecovery-cli as shown in the example to recover 2of2 CSV wallet.

OS is Ubuntu 20.04.3 LTS with a freshly made Bitcoin Core full node with only a single wallet, which is active configured for RPC (username rpcuser, password rpcpassword to match the values bitcoincore.py)

It runs for about an hour and then crashes with the following. CSV file is 0 bytes. Confirmed I can communicate with the local RPC server.

Things I have tried:

Am i doing something wrong? I have been trying various configurations getting everything to work together for about two days, but I haven't been able to have any success, which is very discouraging.

$ garecovery-cli 2of2-csv -o garecovery.csv mnemonic/hex seed: [Redacted] WARNING:root:This step may take 10 minutes or more Traceback (most recent call last): File "/home/user/Downloads/garecovery-master/venv/bin/garecovery-cli", line 7, in <module> sys.exit(recoverycli.main(sys.argv)) File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/recoverycli.py", line 98, in main txs = recovery.get_transactions() File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 198, in get_transactions utxos = self.scan_subaccount(subaccount_pointer, clargs.args.key_search_depth) File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 94, in scan_subaccount new_utxos = self.get_utxos(outputs) File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 55, in get_utxos result = core.importmulti(requests) File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/bitcoinrpc/authproxy.py", line 139, in __call__ response = self._get_response() File "/home/user/Downloads/garecovery-master/venv/lib/python3.8/site-packages/bitcoinrpc/authproxy.py", line 179, in _get_response http_response = self.__conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1344, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 307, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 268, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.8/socket.py", line 669, in readinto return self._sock.recv_into(b) socket.timeout: timed out

LeoComandini commented 2 years ago

It runs for about an hour and then crashes with the following. ... socket.timeout: timed out

Hi @winchip2 , sorry to hear you have issues. Can you please try with

$ garecovery-cli 2of2-csv -o garecovery.csv --ignore-mempool

With --ignore-mempool the tools uses scantxoutset, instead of importmulti to look for unspent outputs belonging to the wallet being recovered. It ignores spent outputs the wallet owned, and ignores (and won't recover) unconfirmed outputs (in mempool). It's much faster, so it could be a good compromise for you. If you have unconfirmed outputs, you can recover them running the tool again with --ignore-mempool once those outputs will be confirmed.

winchip2 commented 2 years ago

It runs for about an hour and then crashes with the following. ... socket.timeout: timed out

Hi @winchip2 , sorry to hear you have issues. Can you please try with

$ garecovery-cli 2of2-csv -o garecovery.csv --ignore-mempool

With --ignore-mempool the tools uses scantxoutset, instead of importmulti to look for unspent outputs belonging to the wallet being recovered. It ignores spent outputs the wallet owned, and ignores (and won't recover) unconfirmed outputs (in mempool). It's much faster, so it could be a good compromise for you. If you have unconfirmed outputs, you can recover them running the tool again with --ignore-mempool once those outputs will be confirmed.

Thank you for the reply!

I ran the command as stated. It asked for my mnemonic, ran about 10 minutes and then stopped without any output to the console.

The csv file only contains the following line: tx id,lock time,total out,destination address,coin value,raw tx

I do now see my transactions in my full node's wallet, however in the "Watch-only" section, and since the csv file is empty besides that one line I don't have the information to broadcast these transactions...

I can still access my Green wallet from a phone, so I see everything's there, and it seems as though all the transactions on this wallet are post-nLockTime so as far as I understand it should be able to run successfully with the option 2of2-csv.

LeoComandini commented 2 years ago

The csv file only contains the following line: tx id,lock time,total out,destination address,coin value,raw tx ... all the transactions on this wallet are post-nLockTime so as far as I understand it should be able to run successfully with the option 2of2-csv.

To spend your outputs without Green 2FA, you also need to wait for some blocks (~12 months by default) to spend those, more details here.

The empty file suggests that your outputs may not be expired yet. To confirm that you can run the tool with the verbose option

garecovery-cli 2of2-csv -o garecovery.csv --ignore-mempool -v

It prints a more verbose output, and if you must wait more blocks to spend those coins, then it will include some lines such as "Skipping utxo ({TXID}:{VOUT}) not expired ({N} blocks left)".