light only Note that we are leaking to light vendor information about the full chain. If the light vendor was a party to any previous transaction in this chain, he'll know how much we received.
503460
function checkThatEachChainElementIncludesThePrevious(arrPrivateElements, handleResult){
	if (arrPrivateElements.length === 1) // an issue
		return handleResult(true);
	var arrUnits = arrPrivateElements.map(function(objPrivateElement){ return objPrivateElement.unit; });
	requestFromLightVendor('light/get_link_proofs', arrUnits, function(ws, request, response){
		if (response.error)
			return handleResult(null); // undefined result
		var arrChain = response;
		if (!ValidationUtils.isNonemptyArray(arrChain))
			return handleResult(null); // undefined result
		light.processLinkProofs(arrUnits, arrChain, {
			ifError: function(err){
				console.log("linkproof validation failed: "+err);
				throw Error(err);
				handleResult(false);
			},
			ifOk: function(){
				console.log("linkproof validated ok");
				handleResult(true);
			}
		});
	});
}
659520
def answer
      if trx = LolitaFirstData::Transaction.where(transaction_id: params[:trans_id]).first
        response = gateway.result(params[:trans_id], client_ip_addr: request.remote_ip)
        trx.process_result(response)
        redirect_to trx.return_path
      else
        render text: I18n.t('fd.wrong_request'), status: 400
      end
    ensure
      if trx
        LolitaFirstData.logger.info("[#{session_id}][#{trx.paymentable_id}][answer] #{response}")
      end
    end
180691
protected void prepareTransactionMemoriesIfExists() {
        final SavedTransactionMemories memories = ThreadCacheContext.findTransactionMemories();
        if (memories != null) {
            final List<TransactionMemoriesProvider> providerList = memories.getOrderedProviderList();
            final StringBuilder sb = new StringBuilder();
            for (TransactionMemoriesProvider provider : providerList) {
                provider.provide().ifPresent(result -> sb.append("\n*").append(result));
            }
            final WholeShowAttribute attribute = new WholeShowAttribute(sb.toString().trim());
            requestManager.setAttribute(LastaWebKey.DBFLUTE_TRANSACTION_MEMORIES_KEY, attribute);
        }
    }
561410
private TransactionStatus computeNewTransactionStatusFromPaymentTransactionInfoPlugin(final PaymentTransactionInfoPlugin input, final TransactionStatus currentTransactionStatus) {
        final TransactionStatus newTransactionStatus = PaymentTransactionInfoPluginConverter.toTransactionStatus(input);
        return (newTransactionStatus != TransactionStatus.UNKNOWN) ? newTransactionStatus : currentTransactionStatus;
    }
943260
def balance(self):
        """"""
        self.check()
        if not sum(map(lambda x: x.amount, self.src)) == -self.amount:
            raise XnBalanceError("Sum of source amounts "
                                 "not equal to transaction amount")
        if not sum(map(lambda x: x.amount, self.dst)) == self.amount:
            raise XnBalanceError("Sum of destination amounts "
                                 "not equal to transaction amount")
        return True
181007
function pickMultipleCoinsAndContinue(){
		conn.query(
			"SELECT unit, message_index, output_index, amount, address, blinding \n\
			FROM outputs \n\
			CROSS JOIN units USING(unit) \n\
			WHERE address IN(?) AND asset"+(asset ? "="+conn.escape(asset) : " IS NULL")+" AND is_spent=0 \n\
				AND sequence='good' "+confirmation_condition+"  \n\
			ORDER BY amount DESC LIMIT ?",
			[arrSpendableAddresses, constants.MAX_INPUTS_PER_PAYMENT_MESSAGE-2],
			function(rows){
				async.eachSeries(
					rows,
					function(row, cb){
						var input = row;
						objectHash.cleanNulls(input);
						required_amount += is_base*TRANSFER_INPUT_SIZE;
						addInput(input);
						// if we allow equality, we might get 0 amount for change which is invalid
						var bFound = is_base ? (total_amount > required_amount) : (total_amount >= required_amount);
						bFound ? cb('found') : cb();
					},
					function(err){
						if (err === 'found')
							onDone(arrInputsWithProofs, total_amount);
						else if (asset)
							issueAsset();
						else
							addHeadersCommissionInputs();
					}
				);
			}
		);
	}
151640
def check(self):
        
        self._check_tx_inout_count()
        self._check_txs_out()
        self._check_txs_in()
        # Size limits
        self._check_size_limit()
801548
def _fulfill(self, *args, **kwargs):
        
        tx_hash = self.send_transaction('fulfill', args, **kwargs)
        receipt = self.get_tx_receipt(tx_hash)
        return receipt.status == 1
852523
public boolean isWatching() {
        BasicKeyChain.State basicState = basic.isWatching();
        BasicKeyChain.State activeState = BasicKeyChain.State.EMPTY;
        if (chains != null && !chains.isEmpty()) {
            if (getActiveKeyChain().isWatching())
                activeState = BasicKeyChain.State.WATCHING;
            else
                activeState = BasicKeyChain.State.REGULAR;
        }
        if (basicState == BasicKeyChain.State.EMPTY) {
            if (activeState == BasicKeyChain.State.EMPTY)
                throw new IllegalStateException("Empty key chain group: cannot answer isWatching() query");
            return activeState == BasicKeyChain.State.WATCHING;
        } else if (activeState == BasicKeyChain.State.EMPTY)
            return basicState == BasicKeyChain.State.WATCHING;
        else {
            if (activeState != basicState)
                throw new IllegalStateException("Mix of watching and non-watching keys in wallet");
            return activeState == BasicKeyChain.State.WATCHING;
        }
    }
359048
def reqAccountSummary(self, reqId, groupName, tags):
        """"""
        return _swigibpy.EClientSocketBase_reqAccountSummary(self, reqId, groupName, tags)
1137851
def set_offchain_reveal_state(
        transfers_pair: List[MediationPairState],
        payee_address: Address,
) -> None:
    
    for pair in transfers_pair:
        if pair.payee_address == payee_address:
            pair.payee_state = 'payee_secret_revealed'
831839
def consume(self, amount=1):
        """"""
        # First, cleanup old stock
        current = self.leak()

        if current + amount > self.capacity:
            return False

        self._incr(amount)
        return True
890755
function sortTransactions(allTransactions, callback) {
    allTransactions.push(notificationDetails.transaction);

    var txns = _.uniq(allTransactions, function(tx) {
      return tx.hash;
    });

    txns.sort(utils.compareTransactions);

    callback(null, txns);
  }
148152
def summary(self):
        """"""
        return "\n".join([
            "Transaction:",
            "  When:        " + self.date.strftime("%a %d %b %Y"),
            "  Description: " + self.desc.replace('\n', ' '),
            "  For amount:  {}".format(self.amount),
            "  From:        {}".format(
                ", ".join(map(lambda x: x.account, self.src)) if self.src \
                    else "UNKNOWN"
            ),
            "  To:          {}".format(
                ", ".join(map(lambda x: x.account, self.dst)) if self.dst \
                    else "UNKNOWN"
            ),
            ""
        ])
811818
function notifyLightClientsAboutStableJoints(from_mci, to_mci) {
	db.query(
		"SELECT peer FROM units JOIN unit_authors USING(unit) JOIN watched_light_addresses USING(address) \n\
		WHERE main_chain_index>? AND main_chain_index<=? \n\
		UNION \n\
		SELECT peer FROM units JOIN outputs USING(unit) JOIN watched_light_addresses USING(address) \n\
		WHERE main_chain_index>? AND main_chain_index<=? \n\
		UNION \n\
		SELECT peer FROM units JOIN watched_light_units USING(unit) \n\
		WHERE main_chain_index>? AND main_chain_index<=?",
		[from_mci, to_mci, from_mci, to_mci, from_mci, to_mci],
		function (rows) {
			rows.forEach(function (row) {
				let ws = getPeerWebSocket(row.peer);
				if (ws && ws.readyState === ws.OPEN)
					sendJustsaying(ws, 'light/have_updates');
			});
			db.query("DELETE FROM watched_light_units \n\
				WHERE unit IN (SELECT unit FROM units WHERE main_chain_index>? AND main_chain_index<=?)", [from_mci, to_mci], function () {

			});
		}
	);
}
418391
public boolean isCommitted() {
		//the message is an incoming request for which a final response has been generated
		if(getTransaction() instanceof ServerTransaction &&
				(RoutingState.FINAL_RESPONSE_SENT.equals(routingState) || isFinalResponseGenerated)) {
			return true;
		}
		//the message is an outgoing request which has been sent
		if(getTransaction() instanceof ClientTransaction && this.isMessageSent) {
			return true;
		}
		/*
		if(Request.ACK.equals((((Request)message).getMethod()))) {
			return true;
		}*/
		return false;
	}
809044
def IsAllSpent(self):
        
        for item in self.Items:
            if item == CoinState.Confirmed:
                return False
        return True