MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / __init__

Method __init__

contrib/linearize/linearize-data.py:93–125  ·  view source on GitHub ↗
(self, settings, blkindex, blkmap)

Source from the content-addressed store, hash-verified

91
92class BlockDataCopier:
93 def __init__(self, settings, blkindex, blkmap):
94 self.settings = settings
95 self.blkindex = blkindex
96 self.blkmap = blkmap
97
98 # Get first occurring block file id - for pruned nodes this
99 # will not necessarily be 0
100 self.inFn = getFirstBlockFileId(self.settings['input'])
101 self.inF = None
102 self.outFn = 0
103 self.outsz = 0
104 self.outF = None
105 self.outFname = None
106 self.blkCountIn = 0
107 self.blkCountOut = 0
108 self.xor_key = read_xor_key(self.settings['input'])
109
110 self.lastDate = datetime.datetime(2000, 1, 1)
111 self.highTS = 1408893517 - 315360000
112 self.timestampSplit = False
113 self.fileOutput = True
114 self.setFileTime = False
115 self.maxOutSz = settings['max_out_sz']
116 if 'output' in settings:
117 self.fileOutput = False
118 if settings['file_timestamp'] != 0:
119 self.setFileTime = True
120 if settings['split_timestamp'] != 0:
121 self.timestampSplit = True
122 # Extents and cache for out-of-order blocks
123 self.blockExtents = {}
124 self.outOfOrderData = {}
125 self.outOfOrderSize = 0 # running total size for items in outOfOrderData
126
127 def read_xored(self, f, size):
128 offset = f.tell()

Callers

nothing calls this directly

Calls 2

getFirstBlockFileIdFunction · 0.85
read_xor_keyFunction · 0.85

Tested by

no test coverage detected