tfchain/TFChainWallet.py
def _sign_and_submit_txn(self, txn, balance):
        """
        common sign and submit logic for all 3Bot Transactions
        """
        # generate the signature requests
        sig_requests = txn.signature_requests_new()
        if len(sig_requests) == 0:
            raise Exception("BUG: sig requests should not be empty at this point, please fix or report as an issue")

        # fulfill the signature requests that we can fulfill
        for request in sig_requests:
            try:
                key_pair = self._wallet.key_pair_get(request.wallet_address)
                input_hash = request.input_hash_new(public_key=key_pair.public_key)
                signature = key_pair.sign(input_hash)
                request.signature_fulfill(public_key=key_pair.public_key, signature=signature)
            except KeyError:
                pass # this is acceptable due to how we directly try the key_pair_get method

        # txn should be fulfilled now
        submit = txn.is_fulfilled()
        if submit:
            # submit the transaction
            txn.id = self._transaction_put(transaction=txn)

            # update balance
            for ci in txn.coin_inputs:
                balance.output_add(ci.parent_output, confirmed=False, spent=True)
            addresses = self._wallet.addresses + balance.addresses_multisig
            for idx, co in enumerate(txn.coin_outputs):
                if str(co.condition.unlockhash) in addresses:
                    # add the id to the coin_output, so we can track it has been spent
                    co.id = txn.coin_outputid_new(idx)
                    balance.output_add(co, confirmed=False, spent=False)
        # and return the created/submitted transaction for optional user consumption
        return TransactionSendResult(txn, submit)

        common sign and submit logic for all 3Bot Transactions
        
common sign and submit logic for all 3Bot Transactions
common sign and submit logic for all 3Bot Transactions
def _sign_and_submit_txn(self, txn, balance):
        sig_requests = txn.signature_requests_new()
        if len(sig_requests) == 0:
            raise Exception("BUG: sig requests should not be empty at this point, please fix or report as an issue")
        for request in sig_requests:
            try:
                key_pair = self._wallet.key_pair_get(request.wallet_address)
                input_hash = request.input_hash_new(public_key=key_pair.public_key)
                signature = key_pair.sign(input_hash)
                request.signature_fulfill(public_key=key_pair.public_key, signature=signature)
            except KeyError:
                pass 
        submit = txn.is_fulfilled()
        if submit:
            txn.id = self._transaction_put(transaction=txn)
            for ci in txn.coin_inputs:
                balance.output_add(ci.parent_output, confirmed=False, spent=True)
            addresses = self._wallet.addresses + balance.addresses_multisig
            for idx, co in enumerate(txn.coin_outputs):
                if str(co.condition.unlockhash) in addresses:
                    co.id = txn.coin_outputid_new(idx)
                    balance.output_add(co, confirmed=False, spent=False)
        return TransactionSendResult(txn, submit)
def _sign_and_submit_txn ( self , txn , balance ) : sig_requests = txn . signature_requests_new ( ) if len ( sig_requests ) == 0 : raise Exception ( "BUG: sig requests should not be empty at this point, please fix or report as an issue" ) for request in sig_requests : try : key_pair = self . _wallet . key_pair_get ( request . wallet_address ) input_hash = request . input_hash_new ( public_key = key_pair . public_key ) signature = key_pair . sign ( input_hash ) request . signature_fulfill ( public_key = key_pair . public_key , signature = signature ) except KeyError : pass submit = txn . is_fulfilled ( ) if submit : txn . id = self . _transaction_put ( transaction = txn ) for ci in txn . coin_inputs : balance . output_add ( ci . parent_output , confirmed = False , spent = True ) addresses = self . _wallet . addresses + balance . addresses_multisig for idx , co in enumerate ( txn . coin_outputs ) : if str ( co . condition . unlockhash ) in addresses : co . id = txn . coin_outputid_new ( idx ) balance . output_add ( co , confirmed = False , spent = False ) return TransactionSendResult ( txn , submit )
common sign and submit logic for all 3Bot Transactions
common sign and submit logic for all 3Bot Transactions
"""
        common sign and submit logic for all 3Bot Transactions
        """ # generate the signature requests # fulfill the signature requests that we can fulfill # this is acceptable due to how we directly try the key_pair_get method # txn should be fulfilled now # submit the transaction # update balance # add the id to the coin_output, so we can track it has been spent # and return the created/submitted transaction for optional user consumption
self
txn
balance