Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when recovering 2of2 wallet #44

Open
winchip2 opened this issue Nov 18, 2021 · 3 comments
Open

Crash when recovering 2of2 wallet #44

winchip2 opened this issue Nov 18, 2021 · 3 comments

Comments

@winchip2
Copy link

winchip2 commented Nov 18, 2021

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:

  • Found out by reading the error logs and then bitcoincore.py that you must use the default rpcuser and rpcpassword
  • Specifying 127.0.0.1, which gave me an error it couldn't talk to 0.0.0.0
  • Applied an rpcauth string of rpcuser / rpcpassword according to https://jlopp.github.io/bitcoin-core-rpc-auth-generator/ - no idea if this is even correct?
  • Commented out the rpcauth line entirely - no change in behavior, so assuming it's not needed
  • set server=1 in bitcoin.conf to allow command line and RPC commands
  • Verified my wallet is loading correctly
  • Confirmed RPC connectivity with bitcoin-cli getblockchaininfo
  • Making sure port 8333 is open for Bitcoin Core, then closing it intentionally to see if the output of gaercovery-cli was different (it wasn't)

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
Copy link
Collaborator

LeoComandini commented Nov 19, 2021

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
Copy link
Author

winchip2 commented Nov 19, 2021

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
Copy link
Collaborator

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)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants