hydrachain/hdc_service.py
def add_transaction(self, tx, origin=None, force_broadcast=False):
        """
        Warning:
        Locking proposal_lock may block incoming events which are necessary to unlock!
        I.e. votes / blocks!
        Take care!
        """
        self.consensus_manager.log(
            'add_transaction', blk=self.chain.head_candidate, lock=self.proposal_lock)
        log.debug('add_transaction', lock=self.proposal_lock)
        block = self.proposal_lock.block
        self.proposal_lock.acquire()
        self.consensus_manager.log('add_transaction acquired lock', lock=self.proposal_lock)
        assert not hasattr(self.chain.head_candidate, 'should_be_locked')
        success = super(ChainService, self).add_transaction(tx, origin, force_broadcast)
        if self.proposal_lock.is_locked():  # can be unlock if we are at a new block
            self.proposal_lock.release(if_block=block)
        log.debug('added transaction', num_txs=self.chain.head_candidate.num_transactions())
        return success
def add_transaction(self, tx, origin=None, force_broadcast=False):
        """
        Warning:
        Locking proposal_lock may block incoming events which are necessary to unlock!
        I.e. votes / blocks!
        Take care!
        """
        self.consensus_manager.log(
            'add_transaction', blk=self.chain.head_candidate, lock=self.proposal_lock)
        log.debug('add_transaction', lock=self.proposal_lock)
        block = self.proposal_lock.block
        self.proposal_lock.acquire()
        self.consensus_manager.log('add_transaction acquired lock', lock=self.proposal_lock)
        assert not hasattr(self.chain.head_candidate, 'should_be_locked')
        success = super(ChainService, self).add_transaction(tx, origin, force_broadcast)
        if self.proposal_lock.is_locked():  # can be unlock if we are at a new block
            self.proposal_lock.release(if_block=block)
        log.debug('added transaction', num_txs=self.chain.head_candidate.num_transactions())
        return success
def add_transaction ( self , tx , origin = None , force_broadcast = False ) : self . consensus_manager . log ( 'add_transaction' , blk = self . chain . head_candidate , lock = self . proposal_lock ) log . debug ( 'add_transaction' , lock = self . proposal_lock ) block = self . proposal_lock . block self . proposal_lock . acquire ( ) self . consensus_manager . log ( 'add_transaction acquired lock' , lock = self . proposal_lock ) assert not hasattr ( self . chain . head_candidate , 'should_be_locked' ) success = super ( ChainService , self ) . add_transaction ( tx , origin , force_broadcast ) if self . proposal_lock . is_locked ( ) : # can be unlock if we are at a new block self . proposal_lock . release ( if_block = block ) log . debug ( 'added transaction' , num_txs = self . chain . head_candidate . num_transactions ( ) ) return success
Warning:
        Locking proposal_lock may block incoming events which are necessary to unlock!
        I.e. votes / blocks!
        Take care!
Warning : Locking proposal_lock may block incoming events which are necessary to unlock! I . e . votes / blocks! Take care!