Copy object contents from buffers on instantiation
- this may fix some memory issues
This commit is contained in:
parent
3c3d69e5de
commit
4690dd6f00
|
@ -40,8 +40,9 @@ class BMObject(object):
|
||||||
self.version = version
|
self.version = version
|
||||||
self.streamNumber = streamNumber
|
self.streamNumber = streamNumber
|
||||||
self.inventoryHash = calculateInventoryHash(data)
|
self.inventoryHash = calculateInventoryHash(data)
|
||||||
self.data = data
|
# copy to avoid memory issues
|
||||||
self.tag = data[payloadOffset:payloadOffset+32]
|
self.data = bytearray(data)
|
||||||
|
self.tag = self.data[payloadOffset:payloadOffset+32]
|
||||||
|
|
||||||
def checkProofOfWorkSufficient(self):
|
def checkProofOfWorkSufficient(self):
|
||||||
# Let us check to make sure that the proof of work is sufficient.
|
# Let us check to make sure that the proof of work is sufficient.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user