Skip to content
Snippets Groups Projects
Commit 0c74d0fd authored by inso's avatar inso
Browse files

Fixing a bug with certification

parent b51edccb
No related branches found
No related tags found
No related merge requests found
...@@ -113,12 +113,18 @@ class Account(object): ...@@ -113,12 +113,18 @@ class Account(object):
def certify(self, password, community, pubkey): def certify(self, password, community, pubkey):
certified = Person.lookup(pubkey, community) certified = Person.lookup(pubkey, community)
block = community.get_block()
block_hash = hashlib.sha1(block.signed_raw().encode("ascii")).hexdigest().upper() try:
block = community.get_block()
block_hash = hashlib.sha1(block.signed_raw().encode("ascii")).hexdigest().upper()
block_number = block['number']
except ValueError as e:
block_number = 0
block_hash = "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
certification = Certification(PROTOCOL_VERSION, community.currency, certification = Certification(PROTOCOL_VERSION, community.currency,
self.pubkey, certified.pubkey, self.pubkey, certified.pubkey,
block_hash, block.number, None) block_hash, block_number, None)
selfcert = certified.selfcert(community) selfcert = certified.selfcert(community)
logging.debug("SelfCertification : {0}".format(selfcert.raw())) logging.debug("SelfCertification : {0}".format(selfcert.raw()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment