pybitmessage.network.bmobject module

BMObject and it’s exceptions.

exception BMObjectInsufficientPOWError[source]

Bases: exceptions.Exception

Exception indicating the object doesn’t have sufficient proof of work.

errorCodes = 'Insufficient proof of work'
exception BMObjectInvalidDataError[source]

Bases: exceptions.Exception

Exception indicating the data being parsed does not match the specification.

errorCodes = 'Data invalid'
exception BMObjectExpiredError[source]

Bases: exceptions.Exception

Exception indicating the object’s lifetime has expired.

errorCodes = 'Object expired'
exception BMObjectUnwantedStreamError[source]

Bases: exceptions.Exception

Exception indicating the object is in a stream we didn’t advertise as being interested in.

errorCodes = 'Object in unwanted stream'
exception BMObjectInvalidError[source]

Bases: exceptions.Exception

The object’s data does not match object specification.

errorCodes = 'Invalid object'
exception BMObjectAlreadyHaveError[source]

Bases: exceptions.Exception

We received a duplicate object (one we already have)

errorCodes = 'Already have this object'
class BMObject(nonce, expiresTime, objectType, version, streamNumber, data, payloadOffset)[source]

Bases: object

Bitmessage Object as a class.

maxTTL = 2430000
minTTL = -3600
checkProofOfWorkSufficient()

Perform a proof of work check for sufficiency.

checkEOLSanity()

Check if object’s lifetime isn’t ridiculously far in the past or future.

checkStream()

Check if object’s stream matches streams we are interested in

checkAlreadyHave()

Check if we already have the object (so that we don’t duplicate it in inventory or advertise it unnecessarily)

checkObjectByType()

Call a object type specific check (objects can have additional checks based on their types)

checkMessage()

“Message” object type checks.

checkGetpubkey()

“Getpubkey” object type checks.

checkPubkey()

“Pubkey” object type checks.

checkBroadcast()

“Broadcast” object type checks.