// LocalConclude concludes a transaction started by LocalBegin.
// If the transaction was not previously concluded, it's rolled back.
346104
func (axp *TxPool) LocalConclude(ctx context.Context, conn *TxConnection) {
	span, ctx := trace.NewSpan(ctx, "TxPool.LocalConclude")
	defer span.Finish()
	if conn.DBConn != nil {
		_ = axp.localRollback(ctx, conn)
	}
}
655921
func (s *SnapshotGetRepositoryService) Local(local bool) *SnapshotGetRepositoryService {
	s.local = &local
	return s
}
419564
func (s *GetMappingService) Local(local bool) *GetMappingService {
	s.local = &local
	return s
}
482729
func (bs *baseVCSSource) updateLocal(ctx context.Context) error {
	err := bs.repo.fetch(ctx)

	if err != nil {
		return unwrapVcsErr(err)
	}
	return nil
}
155584
func (daemon *Daemon) localNetworksPrune(ctx context.Context, pruneFilters filters.Args) *types.NetworksPruneReport {
	rep := &types.NetworksPruneReport{}

	until, _ := getUntilFromPruneFilters(pruneFilters)

	// When the function returns true, the walk will stop.
	l := func(nw libnetwork.Network) bool {
		select {
		case <-ctx.Done():
			// context cancelled
			return true
		default:
		}
		if nw.Info().ConfigOnly() {
			return false
		}
		if !until.IsZero() && nw.Info().Created().After(until) {
			return false
		}
		if !matchLabels(pruneFilters, nw.Info().Labels()) {
			return false
		}
		nwName := nw.Name()
		if runconfig.IsPreDefinedNetwork(nwName) {
			return false
		}
		if len(nw.Endpoints()) > 0 {
			return false
		}
		if err := daemon.DeleteNetwork(nw.ID()); err != nil {
			logrus.Warnf("could not remove local network %s: %v", nwName, err)
			return false
		}
		rep.NetworksDeleted = append(rep.NetworksDeleted, nwName)
		return false
	}
	daemon.netController.WalkNetworks(l)
	return rep
}
1312436
func (s *UpdateByQueryService) XSourceInclude(xSourceInclude ...string) *UpdateByQueryService {
	s.xSourceInclude = append(s.xSourceInclude, xSourceInclude...)
	return s
}
391746
func (section *Section) AddInclude(filename string) {
	section.includes = append(section.includes, filename)
}
1077657
func (s *IndicesGetSettingsService) Local(local bool) *IndicesGetSettingsService {
	s.local = &local
	return s
}
1212940
func (e *Endpoint) ConntrackLocalLocked() bool {
	if e.SecurityIdentity == nil || e.Options == nil ||
		!e.Options.IsEnabled(option.ConntrackLocal) {
		return false
	}

	return true
}
533997
func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel, signer input.Signer,
	pCache PreimageCache, commitTx *wire.MsgTx,
	localCommit channeldb.ChannelCommitment) (*LocalForceCloseSummary, error) {

	// Re-derive the original pkScript for to-self output within the
	// commitment transaction. We'll need this to find the corresponding
	// output in the commitment transaction and potentially for creating
	// the sign descriptor.
	csvTimeout := uint32(chanState.LocalChanCfg.CsvDelay)
	revocation, err := chanState.RevocationProducer.AtIndex(
		localCommit.CommitHeight,
	)
	if err != nil {
		return nil, err
	}
	commitPoint := input.ComputeCommitmentPoint(revocation[:])
	keyRing := deriveCommitmentKeys(commitPoint, true, &chanState.LocalChanCfg,
		&chanState.RemoteChanCfg)
	selfScript, err := input.CommitScriptToSelf(csvTimeout, keyRing.DelayKey,
		keyRing.RevocationKey)
	if err != nil {
		return nil, err
	}
	payToUsScriptHash, err := input.WitnessScriptHash(selfScript)
	if err != nil {
		return nil, err
	}

	// Locate the output index of the delayed commitment output back to us.
	// We'll return the details of this output to the caller so they can
	// sweep it once it's mature.
	var (
		delayIndex  uint32
		delayScript []byte
	)
	for i, txOut := range commitTx.TxOut {
		if !bytes.Equal(payToUsScriptHash, txOut.PkScript) {
			continue
		}

		delayIndex = uint32(i)
		delayScript = txOut.PkScript
		break
	}

	// With the necessary information gathered above, create a new sign
	// descriptor which is capable of generating the signature the caller
	// needs to sweep this output. The hash cache, and input index are not
	// set as the caller will decide these values once sweeping the output.
	// If the output is non-existent (dust), have the sign descriptor be
	// nil.
	var commitResolution *CommitOutputResolution
	if len(delayScript) != 0 {
		singleTweak := input.SingleTweakBytes(
			commitPoint, chanState.LocalChanCfg.DelayBasePoint.PubKey,
		)
		localBalance := localCommit.LocalBalance
		commitResolution = &CommitOutputResolution{
			SelfOutPoint: wire.OutPoint{
				Hash:  commitTx.TxHash(),
				Index: delayIndex,
			},
			SelfOutputSignDesc: input.SignDescriptor{
				KeyDesc:       chanState.LocalChanCfg.DelayBasePoint,
				SingleTweak:   singleTweak,
				WitnessScript: selfScript,
				Output: &wire.TxOut{
					PkScript: delayScript,
					Value:    int64(localBalance.ToSatoshis()),
				},
				HashType: txscript.SigHashAll,
			},
			MaturityDelay: csvTimeout,
		}
	}

	// Once the delay output has been found (if it exists), then we'll also
	// need to create a series of sign descriptors for any lingering
	// outgoing HTLC's that we'll need to claim as well.
	txHash := commitTx.TxHash()
	htlcResolutions, err := extractHtlcResolutions(
		SatPerKWeight(localCommit.FeePerKw), true, signer,
		localCommit.Htlcs, keyRing, &chanState.LocalChanCfg,
		&chanState.RemoteChanCfg, txHash, pCache)
	if err != nil {
		return nil, err
	}

	return &LocalForceCloseSummary{
		ChanPoint:        chanState.FundingOutpoint,
		CloseTx:          commitTx,
		CommitResolution: commitResolution,
		HtlcResolutions:  htlcResolutions,
		ChanSnapshot:     *chanState.Snapshot(),
	}, nil
}
255843
func (s *SearchShardsService) Local(local bool) *SearchShardsService {
	s.local = &local
	return s
}
1076484
func WriteLocalConfig(config *LocalConfig) error {
	task := "Write the local configuration file"

	// Get the local configuration file absolute path.
	path, err := LocalConfigFileAbsolutePath()
	if err != nil {
		return errs.NewError(task, err)
	}

	// Write the file.
	if err := writeConfig(path, config, 0600); err != nil {
		return errs.NewError(task, err)
	}

	return nil
}
456053
func (s *GetBundlesInput) SetIncludeInactive(v bool) *GetBundlesInput {
	s.IncludeInactive = &v
	return s
}
1021550
func (axp *TxPool) LocalCommit(ctx context.Context, conn *TxConnection, mc messageCommitter) (string, error) {
	span, ctx := trace.NewSpan(ctx, "TxPool.LocalCommit")
	defer span.Finish()
	defer conn.conclude(TxCommit, "transaction committed")
	defer mc.LockDB(conn.NewMessages, conn.ChangedMessages)()

	if conn.Autocommit {
		mc.UpdateCaches(conn.NewMessages, conn.ChangedMessages)
		return "", nil
	}

	if _, err := conn.Exec(ctx, "commit", 1, false); err != nil {
		conn.Close()
		return "", err
	}
	mc.UpdateCaches(conn.NewMessages, conn.ChangedMessages)
	return "commit", nil
}
465544
func (pool *TxPool) local() map[common.Address]types.Transactions {
	txs := make(map[common.Address]types.Transactions)
	for addr := range pool.locals.accounts {
		if pending := pool.pending[addr]; pending != nil {
			txs[addr] = append(txs[addr], pending.Flatten()...)
		}
		if queued := pool.queue[addr]; queued != nil {
			txs[addr] = append(txs[addr], queued.Flatten()...)
		}
	}
	return txs
}
1090177
func (c *CheckRun) GetConclusion() string {
	if c == nil || c.Conclusion == nil {
		return ""
	}
	return *c.Conclusion
}
1112790
func (m *Memberlist) LocalNode() *Node {
	m.nodeLock.RLock()
	defer m.nodeLock.RUnlock()
	state := m.nodeMap[m.config.Name]
	return &state.Node
}