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
615 stars 204 forks source link

Balance on wallet instance is not updated when zero #249

Closed AbsurdlySuspicious closed 1 year ago

AbsurdlySuspicious commented 2 years ago

https://github.com/1200wd/bitcoinlib/blob/777e06695cd9d963796afa5ab890e58d140de784/bitcoinlib/wallets.py#L2568-L2582

(function balance_update_from_serviceprovider)

When balance is zero this if body is not executed and _balances object is not updated. This happens for example after sweep-ing all funds to another wallet, scan() doesn't update balance after this, the only option is to delete wallet instance and re-import it through Wallet constructor

mccwdev commented 1 year ago

Fixed in https://github.com/1200wd/bitcoinlib/commit/3ea1ace3fdf8da2e39e48348cc660a78e574b6b3