jackjack-jj / pywallet

bitcoin wallet importer/exporter
497 stars 347 forks source link

Crashing with "OverflowError: Python int too large to convert to C long" #37

Open paulbdavis opened 3 years ago

paulbdavis commented 3 years ago

Output:

Traceback (most recent call last):
  File "usr/bin/pywallet", line 2260, in parse_wallet
    d['lockTime'] = vds.read_uint64()
  File "usr/bin/pywallet", line 2150, in read_uint64
    def read_uint64(self): return self._read_num('<Q')
  File "usr/bin/pywallet", line 2187, in _read_num
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
OverflowError: Python int too large to convert to C long
ERROR parsing wallet.dat, type tx
key data: tx
key data in hex: [redacted]
value data in hex: [redacted]

This is being run in a docker containter created with the following docker file:

FROM ubuntu:18.04

RUN apt-get update && apt-get install -y build-essential python-dev python-twisted python-bsddb3 python-ecdsa

ADD https://raw.githubusercontent.com/jackjack-jj/pywallet/master/pywallet.py /usr/bin/pywallet
RUN chmod +x /usr/bin/pywallet

ENTRYPOINT ["/usr/bin/pywallet"]

run with:

docker build -t pywallet .
docker run -it --rm -v $PWD/wallets:/wallets pywallet -w /wallets/wallet.dat
jackjack-jj commented 2 years ago

I never encountered this bug Is this a new wallet? Was it created with bitcoin-core?

021-projects commented 4 months ago

+1 The wallet is old, created using bitcoin-cli

Seems corrupted due to bitcoin core crash