|
|
|
@ -36,6 +36,7 @@ if False:
|
|
|
|
|
|
|
|
|
|
# the number of bytes to preallocate for serialized transaction chunks
|
|
|
|
|
_MAX_SERIALIZED_CHUNK_SIZE = const(2048)
|
|
|
|
|
_SERIALIZED_TX_BUFFER = empty_bytearray(_MAX_SERIALIZED_CHUNK_SIZE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Bitcoin:
|
|
|
|
@ -77,6 +78,8 @@ class Bitcoin:
|
|
|
|
|
coin: CoinInfo,
|
|
|
|
|
approver: approvers.Approver | None,
|
|
|
|
|
) -> None:
|
|
|
|
|
global _SERIALIZED_TX_BUFFER
|
|
|
|
|
|
|
|
|
|
self.tx_info = TxInfo(self, helpers.sanitize_sign_tx(tx, coin))
|
|
|
|
|
self.keychain = keychain
|
|
|
|
|
self.coin = coin
|
|
|
|
@ -93,7 +96,8 @@ class Bitcoin:
|
|
|
|
|
self.external: set[int] = set()
|
|
|
|
|
|
|
|
|
|
# transaction and signature serialization
|
|
|
|
|
self.serialized_tx = empty_bytearray(_MAX_SERIALIZED_CHUNK_SIZE)
|
|
|
|
|
_SERIALIZED_TX_BUFFER[:] = bytes()
|
|
|
|
|
self.serialized_tx = _SERIALIZED_TX_BUFFER
|
|
|
|
|
self.tx_req = TxRequest()
|
|
|
|
|
self.tx_req.details = TxRequestDetailsType()
|
|
|
|
|
self.tx_req.serialized = TxRequestSerializedType()
|
|
|
|
|