diff --git a/bip-0352/bitcoin_utils.py b/bip-0352/bitcoin_utils.py index ee55f2d3b3..a1c456c5cf 100644 --- a/bip-0352/bitcoin_utils.py +++ b/bip-0352/bitcoin_utils.py @@ -32,13 +32,11 @@ def deser_txid(txid: str): def deser_compact_size(f: BytesIO): - view = f.getbuffer() - nbytes = view.nbytes; - view.release() - if (nbytes == 0): - return 0 # end of stream + b = f.read(1) + if not b: + return 0 # end of stream - nit = struct.unpack(" List[Dict[str, str]]: +def scanning(b_scan: ECKey, B_spend: ECPubKey, A_sum: ECPubKey, input_hash: bytes, outputs_to_check: List[ECPubKey], labels: Optional[Dict[str, str]] = None) -> List[Dict[str, str]]: + if labels is None: + labels = {} G = ECKey().set(1).get_pubkey() ecdh_shared_secret = input_hash * b_scan * A_sum k = 0