From 292448af50ee5bd39c0d93496c6c80d30df2e295 Mon Sep 17 00:00:00 2001 From: Martijn de Vos Date: Mon, 8 Oct 2018 12:17:52 +0200 Subject: [PATCH] Added return value when creating a source block --- ipv8/attestation/trustchain/community.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipv8/attestation/trustchain/community.py b/ipv8/attestation/trustchain/community.py index 231074750..92537d656 100644 --- a/ipv8/attestation/trustchain/community.py +++ b/ipv8/attestation/trustchain/community.py @@ -183,9 +183,10 @@ def create_source_block(self, block_type=b'unknown', transaction=None): :param block_type: The type of the block to be constructed, as a string :param transaction: A string describing the interaction in this block - :return: None + :return: A deferred that fires with a (block, None) tuple """ - self.sign_block(peer=None, public_key=ANY_COUNTERPARTY_PK, block_type=block_type, transaction=transaction) + return self.sign_block(peer=None, public_key=ANY_COUNTERPARTY_PK, + block_type=block_type, transaction=transaction) def create_link(self, source, block_type=b'unknown', additional_info=None, public_key=None): """ @@ -256,7 +257,7 @@ def sign_block(self, peer, public_key=EMPTY_PK, block_type=b'unknown', transacti if not peer and public_key == ANY_COUNTERPARTY_PK: if self.settings.broadcast_blocks: self.send_block(block) - return + return succeed((block, None)) # If there is a counterparty to sign, we send it self.send_block(block, address=peer.address)