1
0

util: kill bh2u

no longer useful, and the name is so confusing...
This commit is contained in:
SomberNight
2023-02-17 11:35:03 +00:00
parent 1ce37c8bb1
commit 373db76ac9
52 changed files with 151 additions and 168 deletions

View File

@@ -29,7 +29,7 @@ from . import util
from .bitcoin import hash_encode, int_to_hex, rev_hex
from .crypto import sha256d
from . import constants
from .util import bfh, bh2u, with_lock
from .util import bfh, with_lock
from .simple_config import SimpleConfig
from .logging import get_logger, Logger
@@ -408,7 +408,7 @@ class Blockchain(Logger):
# swap parameters
self.parent, parent.parent = parent.parent, self # type: Optional[Blockchain], Optional[Blockchain]
self.forkpoint, parent.forkpoint = parent.forkpoint, self.forkpoint
self._forkpoint_hash, parent._forkpoint_hash = parent._forkpoint_hash, hash_raw_header(bh2u(parent_data[:HEADER_SIZE]))
self._forkpoint_hash, parent._forkpoint_hash = parent._forkpoint_hash, hash_raw_header(parent_data[:HEADER_SIZE].hex())
self._prev_hash, parent._prev_hash = parent._prev_hash, self._prev_hash
# parent's new name
os.replace(child_old_name, parent.path())