Skip to content

Commit

Permalink
Merge pull request #2110 from mhsmith/master
Browse files Browse the repository at this point in the history
Use faster JSON encoder settings when wallet is encrypted
  • Loading branch information
cculianu committed Dec 29, 2020
2 parents 6501e7f + b2399b6 commit cb8ab55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electroncash/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ def _write(self):
return
if not self.modified:
return
s = json.dumps(self.data, indent=4, sort_keys=True)
s = json.dumps(self.data,
indent=None if self.pubkey else 4, # Fast settings if encrypted,
sort_keys=not self.pubkey) # readable settings otherwise.
if self.pubkey:
s = bytes(s, 'utf8')
c = zlib.compress(s)
Expand Down

0 comments on commit cb8ab55

Please sign in to comment.