Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: Pywallet 2.2: manage your wallet [Update required]
by
witcher_sense
on 08/10/2023, 12:13:01 UTC
⭐ Merited by vapourminer (1)
C:\Users\YX\OneDrive\Desktop\test>python pywallet.py --dumpwallet --wallet=.\wallet.dat>wallet.log
Traceback (most recent call last):
  File "pywallet.py", line 2290, in parse_wallet
    d['txIn'].append(parse_TxIn(vds))
  File "pywallet.py", line 2257, in parse_TxIn
    d['prevout_n'] = vds.read_uint32()
  File "pywallet.py", line 2183, in read_uint32
    def read_uint32(self): return self._read_num('<I')
  File "pywallet.py", line 2222, in _read_num
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
error: unpack_from requires a buffer of at least 4 bytes


Prompt this, what should I do?
It looks like a problem with one of the transaction inputs, the wallet tries to parse it with its internal algorithm defined in read_uint32[\tt] function but fails to do so. Try putting this part of the code in a try-catch block and see what happens, maybe it will skip problematic addresses and parse everything else successfully. Or maybe, you need to install an earlier version of Python.