Skip to content

Commit

Permalink
Namecoin: Clear history when upgrading DB to v21
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Feb 17, 2020
1 parent 5feed4e commit c203c88
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions electrum_nmc/electrum/json_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,20 @@ def _convert_version_21(self):
for channel in channels:
channel['state'] = 'OPENING'
self.put('channels', channels)

# Namecoin: Electrum-NMC 3.3.8 and earlier hid the locked 0.01 NMC in
# name outputs from the DB. 4.0.0 and higher don't do this anymore, so
# we need to add 0.01 NMC to every name output. But, doing this
# carefully is complex, so instead we just clear the history and let
# everything recalculate.
self.put('txi', None)
self.put('txo', None)
self.put('spent_outpoints', None)
self.put('transactions', None)
self.put('addr_history', None)
self.put('verified_tx3', None)
self.put('tx_fees', None)

self.put('seed_version', 21)

def _convert_imported(self):
Expand Down

0 comments on commit c203c88

Please sign in to comment.