text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>oArray) statement.executeQuery() .mapCodec(cmdCodec).toSeq } } override def listSettlementCommands(): Seq[(ByteVector32, HtlcSettlementCommand)] = withMetrics("pending-relay/list", DbBackends.Sqlite) { using(sqlite.prepareStatement("SELECT channel_id, data FROM pending_settlemen...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|> => // we don't care about other dead letters } } object ClientSpawner { def props(keyPair: KeyPair, socks5ProxyParams_opt: Option[Socks5ProxyParams], peerConnectionConf: PeerConnection.Conf, switchboard: ActorRef, router: ActorRef): Props = Props(new ClientSpawner(keyPair, socks5ProxyParams_opt, pe...
fim
ACINQ/eclair
scala
<|fim_prefix|>package fr.acinq.eclair.io import akka.actor.typed.delivery.DurableProducerQueue.TimestampMillis import akka.actor.typed.eventstream.EventStream import akka.actor.typed.scaladsl.{ActorContext, Behaviors} import akka.actor.typed.{ActorRef, Behavior} import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey imp...
fim
ACINQ/eclair
scala
<|fim_suffix|>o {}: relaying without channels with the next node is disabled by policy", nextNodeId) replyTo_opt.foreach(_ ! AgainstPolicy(messageId, RelayChannelsOnly)) Behaviors.stopped } } private def waitForConnection(msg: OnionMessage, nextNodeId: PublicKey): Behavior[Command] = { Beha...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma<|fim_suffix|>red by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either e...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>t, isChannelOpener = true, paysCommitTxFees = true, dualFunded = dualFunded, expectedFundingAmount) peer ! Peer.SpawnChannelInitiator(request.replyTo, request.open, ChannelConfig.standard, channelType_opt.get, localParams) waitForRequest() } } private def sanityCheckNonInitiator(reque...
fim
ACINQ/eclair
scala
<|fim_suffix|>ge concurrently, never assume it is fully up-to-date. */ case class GetPeerChannels(replyTo: typed.ActorRef[PeerChannels]) case class ChannelInfo(channel: typed.ActorRef[Command], state: ChannelState, data: ChannelData) case class PeerChannels(nodeId: PublicKey, channels: Seq[ChannelInfo]) case c...
fim
ACINQ/eclair
scala
/* * Copyright 2023 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>ase object ResumeAnnouncements case class DoSync(replacePrevious: Boolean) extends RemoteTypes // @formatter:on val IGNORE_NETWORK_ANNOUNCEMENTS_PERIOD: FiniteDuration = 5 minutes val MAX_FUNDING_TX_ALREADY_SPENT = 250 def props(keyPair: KeyPair, conf: PeerConnection.Conf, switchboard: ActorRe...
fim
ACINQ/eclair
scala
<|fim_suffix|>S, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package fr.acinq.eclair.io import akka.actor.ActorRef import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey import fr...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>nd] = { def stashEvent(remoteNodeId: PublicKey): Boolean = { val hasPendingChannels = channels.contains(remoteNodeId) || pendingPublicNodeChannels.contains(remoteNodeId) || pendingPrivateNodeChannels.contains(remoteNodeId) hasPendingChannels && !stash.isFull } channels.headOption m...
fim
ACINQ/eclair
scala
/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>) } override def mdc(currentMessage: Any): MDC = Logs.mdc(Some(LogCategory.CONNECTION)) } object Server { def props(keyPair: KeyPair, peerConnectionConf: PeerConnection.Conf, switchboard: ActorRef, router: ActorRef, address: InetSocketAddress, bound: Option[Promise[Done]] = None): Props = Props(n...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>fees: MilliSatoshi, startedAt: TimestampMilli, settledAt: TimestampMilli) object PaymentSentSerializer extends ConvertClassSerializer[PaymentSent](p => { val parts = p.parts.map(pp => PaymentPartJson(pp.id, pp.channelId, pp.remoteNodeId, pp.amountWithFees, pp.feesPaid, pp.route, pp.startedAt, pp.settled...
fim
ACINQ/eclair
scala
<|fim_suffix|>Key, encryptedData) match { case Left(RouteBlindingEncryptedDataCodecs.CannotDecryptData(f)) => Left(CannotDecryptBlindedPayload(f)) case Left(RouteBlindingEncryptedDataCodecs.CannotDecodeData(f)) => Left(CannotDecodeBlindedPayload(f)) case Right(decoded) => Right(DecodedEncryptedData(de...
fim
ACINQ/eclair
scala
<|fim_suffix|> } case OfferTypes.RecipientNodeId(nodeId) => sendToDestination(OnionMessages.Recipient(nodeId, None), nodeId) } } } private def waitForNodeId(compactBlindedPath: BlindedRoute): Behavior[Command] = { Behaviors.receiveMessagePartial { case WrappedNodeIdResponse(None)...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>(createdAt, tags, signature)).require val int5s = eight2fiveCodec.decode(data).require.value Bech32.encode(hrp, int5s.toArray, Bech32.Encoding.Bech32) } } object Bolt11Invoice { val DEFAULT_EXPIRY_SECONDS: Long = 3600 val DEFAULT_MIN_CLTV_EXPIRY_DELTA: CltvExpiryDelta = CltvExpiryDelta(18) ...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licens<|fim_suffix|>ustomTlvs)) } def fromString(input: String): Try[MinimalBolt12Invoice] = Try { val triple = Bech32.decodeBytes(input....
fim
ACINQ/eclair
scala
/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>MetadataIncluded = "paymentMetadataIncluded" val Amount = "amount" val TotalAmount = "totalAmount" val RecipientAmount = "recipientAmount" val Expiry = "expiry" val RecipientNodeId = "recipientNodeId" val TargetNodeId = "targetNodeId" val Direction = "direction" object ...
fim
ACINQ/eclair
scala
<|fim_suffix|>nt amount that has been received by the final recipient. * @param recipientNodeId id of the final recipient. * @param parts child payments (actual outgoing HTLCs). * @param remainingAttribution_opt for relayed trampoline payments, the attribution data that needs to ...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|> router ! Router.MessageRouteRequest(context.messageAdapter(WrappedRouterResponse(_)), firstNodeId, nodeParams.nodeId, Set.empty) waitForRoute(firstNodeId, tlvs) case None => // When not using a blinded path, we use our public nodeId for the offer (no privacy). ...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2023 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2023 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>tor.{ActorContext, ActorRef} import akka.event.DiagnosticLoggingAdapter /** * Simple handler that forwards all messages to an actor */ class ForwardHandler(actor: ActorRef) extends ReceiveHandler { override def handle(implicit ctx: ActorContext, log: DiagnosticLoggingAdapter): Receive = { case ms...
fim
ACINQ/eclair
scala
<|fim_suffix|> (fullScan) 0 unixms else now - 15.days val expiredPayments = paymentsDb.listExpiredIncomingPayments(start, now, None) // purge expired payments expiredPayments.foreach(p => paymentsDb.removeIncomingPayment(p.invoice.paymentHash)) // publish a notification when we have pur...
fim
ACINQ/eclair
scala
<|fim_suffix|>Behaviors.stopped } } } private def validatePaymentStatus(add: UpdateAddHtlc, payload: FinalPayload, record: IncomingPayment)(implicit log: LoggingAdapter): Boolean = { if (record.status.isInstanceOf[IncomingPaymentStatus.Received]) { log.warning("ignoring incoming payment for whi...
fim
ACINQ/eclair
scala
<|fim_suffix|>MultiPartPaymentSucceeded(paymentHash: ByteVector32, parts: Queue[PaymentPart]) /** We aborted the payment because of an inconsistency in the payment set or because we didn't receive the total amount in reasonable time. */ case class MultiPartPaymentFailed(paymentHash: ByteVector32, failure: FailureMe...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>se class Payment(replyTo: ActorRef[Result], timeout: BlockHeight, paymentHash: ByteVector32) { def expired(currentBlockHeight: BlockHeight): Boolean = timeout <= currentBlockHeight } case class PeerPayments(notifier: ActorRef[PeerReadyNotifier.Command], pendingPayments: Set[Payment]) { def up...
fim
ACINQ/eclair
scala
<|fim_suffix|>itments.announceChannel != channel2.commitments.announceChannel => !channel1.commitments.announceChannel // otherwise, we use the channel with the smallest capacity to ensure we keep high-capacity channels enabled // (if we ran out of liquidity in a large channels, we would send a channel_...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>back-and-forth between parent and child before stopping the child to prevent a race condition childHandler ! NodeRelay.Stop apply(nodeParams, register, outgoingPaymentFactory, router, children - PaymentKey(paymentHash, paymentSecret)) case GetPendingPayments(replyTo) => ...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2024 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>at may be in a broken state after a restart. * * @param notRelayed incoming HTLCs that were committed upstream but not relayed downstream. * @param relayedOut outgoing HTLC sets that may have been incompletely sent and need to be watched. * @param settledUpstream upstream payments th...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>h(randomBytes32()), // we don't even know the preimage (this needs to be a secure random!) Bolt11Invoice.Description("ignored"), Bolt11Invoice.PaymentSecret(randomBytes32()), Bolt11Invoice.MinFinalCltvExpiry(6), Bolt11Invoice.InvoiceFeatures(Features...
fim
ACINQ/eclair
scala
<|fim_suffix|>copy(firstNodeId = EncodedNodeId.WithPublicKey.Plain(nodeId))) resolveBlindedPaths(paymentRouteWithNodeId +: toResolve, resolved) } } <|fim_prefix|>package fr.acinq.eclair.payment.send import akka.actor.typed.Behavior import akka.actor.typed.scaladsl.{ActorContext, Behaviors} import akka.acto...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|> case WrappedResolvedPaths(resolved) => paymentInitiator ! SendPaymentToNode(replyTo, invoice.amount, invoice, resolved, maxAttempts = sendPaymentConfig.maxAttempts, externalId = sendPaymentConfig.externalId_opt, routeParams = sendPaymentConfig.routeParams, payerKey_opt = Some(payerKey), blockUnt...
fim
ACINQ/eclair
scala
<|fim_suffix|>Invoice { override def getMessage: String = s"unsupported invoice features: ${features.toByteVector.toHex}" } // @formatter:on // @formatter:off /** Payment attempts exhausted without success. */ case object RetryExhausted extends PaymentError { override def getMessage: String = "payment attempts...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>cryptedPayloads.last, customTlvs)) introductionPayload +: intermediatePayloads :+ finalPayload } // The route starts at a remote introduction node: we include the path key in the onion, not in the HTLC. PaymentPayloads(introductionAmount, introductionExpiry, payloads, out...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2024 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2026 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2026 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>.pastEventsChunkDelay) listening(stats4, channels, lastTransactionReadAt) } case RemoveOldBuckets => listening(stats.removeOldBuckets(TimestampMilli.now()), channels, lastTransactionReadAt) case GetLatestStats(replyTo) if !pastEventsLoaded => // This generally...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * <|fim_suffix|>OR CONDITIONS OF ANY KIND, either express or implied. * See the Licens...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>timestamp) } else { // We already expected not to be able to relay that amount as it is above our upper bound. However if the upper bound // was old enough that replacing it with the current amount decreases the success probability for `high`, then we // replace it. val updated...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>cinq.bitcoin.scalacompat.Crypto.PublicKey import fr.acinq.bitcoin.scalacompat.Satoshi import fr.acinq.eclair.ShortChannelId import fr.acinq.eclair.RealShortChannelId import fr.acinq.eclair.remote.EclairInternalsSerializer.RemoteTypes import fr.acinq.eclair.wire.protocol.{ChannelAnnouncement, ChannelUpdate...
fim
ACINQ/eclair
scala
<|fim_suffix|>gExperimentConf(experiments: Map[String, PathFindingConf]) { private val confByPercentile: Array[PathFindingConf] = experiments.values.flatMap(e => Array.fill(e.experimentPercentage)(e)).toArray require(confByPercentile.length == 100, "All experiments percentages must sum to 100.") private val rng...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Ap<|fim_suffix|>Exception("route not found") object BalanceTooLow extends RouterException("balance too low") object CannotRouteToSelf extends RouterException("cannot route to self") <|fim_middle|>ache License, Version 2.0 (the "License"); * you ma...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>tChannelIds.mkString(",")) shortChannelIds.foreach(db.removeChannel(_)) // NB: this also removes channel updates // we also need to remove updates from the graph val graphWithBalances1 = lostChannels.foldLeft(d.graphWithBalances) { (graph, lostChannel) => graph.removeChannel(ChannelDesc(...
fim
ACINQ/eclair
scala
<|fim_suffix|>e } } object Controller { def props(address: InetSocketAddress, protocolHandlerProps: Props)(implicit ec: ExecutionContext = ExecutionContext.global) = Props(new Controller(address, protocolHandlerProps)) case object SendFailed }<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>unexpected server hash") } hmacSHA256(ClientKey, message) } private def sendCommand(cmd: String): Unit = { receiver ! ByteString(s"$cmd\r\n") } } object TorProtocolHandler { def props(authentication: Authentication, privateKeyPath: Path, virtualPort: Int, ...
fim
ACINQ/eclair
scala
<|fim_suffix|> val spec3 = localChanges.foldLeft(spec2) { case (spec, u: UpdateFulfillHtlc) => fulfillIncomingHtlc(spec, u.id) case (spec, u: UpdateFailHtlc) => failIncomingHtlc(spec, u.id) case (spec, u: UpdateFailMalformedHtlc) => failIncomingHtlc(spec, u.id) case (spec, _) => spec } ...
fim
ACINQ/eclair
scala
<|fim_suffix|>681) to speed up confirmation of a commitment transaction. */ def anchor(anchorKey: PublicKey): Seq[ScriptElt] = { // @formatter:off OP_PUSHDATA(anchorKey) :: OP_CHECKSIG :: OP_IFDUP :: OP_NOTIF :: OP_16 :: OP_CHECKSEQUENCEVERIFY :: OP_ENDIF :: Nil // @formatter:on } /*...
fim
ACINQ/eclair
scala
<|fim_suffix|>itmentFormat)) :: Nil, txOut = TxOut(amount, localFinalScriptPubKey) :: Nil, lockTime = 0 ) val unsignedTx = ClaimHtlcSuccessTx(commitKeys, input, tx, preimage, htlc.id, htlc.cltvExpiry, commitmentFormat) skipTxIfBelowDust(unsignedTx, dustLimit) ...
fim
ACINQ/eclair
scala
<|fim_suffix|>License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ex...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>/ def prependmac[A](codec: Codec[A], mac: Mac32): Codec[A] = Codec[A]( (a: A) => codec.encode(a).map(bits => mac.mac(bits.toByteVector).bits ++ bits), (bits: BitVector) => ("mac" | bytes32).decode(bits) match { case Attempt.Successful(DecodeResult(msgMac, remainder)) if mac.verify(msgMac, ...
fim
ACINQ/eclair
scala
<|fim_suffix|> failure => failure.code ) val failureMessageCodec = discriminatorWithDefault( discriminated[FailureMessage].by(uint16) .typecase(PERM | 1, failureTlvsCodec.as[InvalidRealm]) .typecase(NODE | 2, failureTlvsCodec.as[TemporaryNodeFailure]) .typecase(PERM | NODE | 2, failureTlvs...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>orWithDefault(lightningMessageCodec, catchAllCodec(unknownMessageCodec.upcast)) val meteredLightningMessageCodec = Codec[LightningMessage]( (msg: LightningMessage) => KamonExt.time(Metrics.EncodeDuration.withTag(Tags.MessageType, msg.getClass.getSimpleName))(lightningMessageCodecWithFallback.encode...
fim
ACINQ/eclair
scala
<|fim_suffix|>= Relayer.RelayFees(feeBase = feeBaseMsat, feeProportionalMillionths = feeProportionalMillionths) } object ChannelUpdate { case class MessageFlags(dontForward: Boolean) case class ChannelFlags(isEnabled: Boolean, isNode1: Boolean) object ChannelFlags { /** for tests */ val DUMMY: ChannelF...
fim
ACINQ/eclair
scala
<|fim_suffix|>r: Boolean, amount: Satoshi, fees: Fees) { val isSeller: Boolean = !isBuyer } object Codecs { val fundingRate: Codec[FundingRate] = ( ("minAmount" | satoshi32) :: ("maxAmount" | satoshi32) :: ("fundingWeight" | uint16) :: ("feeBasis" | uint16) :: ("feeBas...
fim
ACINQ/eclair
scala
/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>ding. */ case class PathKey(publicKey: PublicKey) extends WillAddHtlcTlv private val pathKey: Codec[PathKey] = (("length" | constant(hex"21")) :: ("pathKey" | publicKey)).as[PathKey] val willAddHtlcTlvCodec: Codec[TlvStream[WillAddHtlcTlv]] = tlvStream(discriminated[WillAddHtlcTlv].by(varint) ...
fim
ACINQ/eclair
scala
<|fim_suffix|>sageTlv { val onionMessageTlvCodec: Codec[TlvStream[OnionMessageTlv]] = tlvStream(discriminated[OnionMessageTlv].by(varint)) } <|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apa<|fim_middle|>che License, Version 2.0 (the "License"); * you may not use this file except in complianc...
fim
ACINQ/eclair
scala