1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
596 stars 199 forks source link

Can't use Wallet scan() and utxos_update() functions at version 0.7.0b1 because of sql errors #408

Closed b0r1ngx closed 1 month ago

b0r1ngx commented 1 month ago

Using version 0.7.0b1 of library leads to errors, some of them:

Using Wallet.scan() or/and Wallet.utxos_update(), getting this error: OperationalError: (sqlite3.OperationalError) no such column: cache_transactions.index

Log:

OperationalError: (sqlite3.OperationalError) no such column: cache_transactions.index
[SQL: SELECT cache_transactions_node.spent AS cache_transactions_node_spent, cache_transactions_node.index_n AS cache_transactions_node_index_n, cache_transactions_node.value AS cache_transactions_node_value, cache_transactions.confirmations AS cache_transactions_confirmations, cache_transactions.block_height AS cache_transactions_block_height, cache_transactions.fee AS cache_transactions_fee, cache_transactions.date AS cache_transactions_date, cache_transactions.txid AS cache_transactions_txid 
FROM cache_transactions_node JOIN cache_transactions ON cache_transactions.txid = cache_transactions_node.txid 
WHERE cache_transactions_node.address = ? AND cache_transactions_node.is_input = 0 AND cache_transactions.network_name = ? ORDER BY cache_transactions.block_height, cache_transactions."index"]
[parameters: ('tb1qd97l9n7nx66ceyndanc2wv2a6ugvxdte4fexwq', 'testnet')]
mccwdev commented 1 month ago

This is because the database files are from a previous version.

See https://github.com/1200wd/bitcoinlib/discussions/409