PaymentChannelManagerActor constructor
PaymentChannelManagerActor({
- required ActorRef walletManager,
- required EventStore eventStore,
- required CryptoService cryptoService,
- NetworkType networkType = dartsv.NetworkType.TEST,
- void eventBroadcaster()?,
- ActorRef? channelProjection,
- ActorRef? arcActor,
- ActorRef? walletProjection,
- Duration signingTimeout = const Duration(seconds: 30),
- Duration broadcastTimeout = const Duration(seconds: 45),
- Duration inFlightTimeout = const Duration(seconds: 30),
- Duration inFlightPollInterval = const Duration(seconds: 1),
- ActorRef? spvActor,
- ReadModelStorage? storage,
- BlockHeaderChain? headerChain,
- required ChannelTiming? timing,
Implementation
PaymentChannelManagerActor({
required ActorRef walletManager,
required EventStore eventStore,
required CryptoService cryptoService,
dartsv.NetworkType networkType = dartsv.NetworkType.TEST,
void Function(ChannelEvent)? eventBroadcaster,
ActorRef? channelProjection,
ActorRef? arcActor,
ActorRef? walletProjection,
Duration signingTimeout = const Duration(seconds: 30),
Duration broadcastTimeout = const Duration(seconds: 45),
Duration inFlightTimeout = const Duration(seconds: 30),
Duration inFlightPollInterval = const Duration(seconds: 1),
ActorRef? spvActor,
/// The wallet read model. **Production always supplies it**
/// (`LibSpiffyActorSystem`), and the manager cannot do its whole job
/// without it. Optional only because thirteen test configurations do
/// not supply one (libspiffy-m0xj): with an empty read model a client
/// open fails at the funding BEEF, so making it required first needs
/// those configurations to fund from a parent they can prove.
///
/// Exactly what is dropped when it is absent — [preStart] logs this too,
/// so an accidental omission is never silent:
///
/// * **A client channel cannot open.** `_buildFundingBeef` has no
/// ancestry to read, so the funding is sent with no BEEF, which
/// servers refuse (libspiffy-fsy).
/// * **A funding retry cannot be refused when its money came back.**
/// `_fundingHoldReleased` reads the deferred-payment record; with no
/// read model it answers "no evidence", which by design never refuses
/// (V-102), so a retry that should be blocked proceeds.
/// * **A funding already recorded in the wallet is recorded again.**
/// `_walletHoldsTransaction` answers false, so an interrupted attempt
/// redoes the write. Safe — the wallet aggregate has its own guard
/// since V-92 — but wasted work.
/// Nothing here is a correctness hole; the first item is a capability
/// that simply does not work.
ReadModelStorage? storage,
/// The node's block headers, for the chain's median time past a refund
/// claim waits for (bead libspiffy-lpjh). Production always supplies
/// them; without them a refund claim is refused.
BlockHeaderChain? headerChain,
/// When channels stop taking payments and how long they must run (bead
/// libspiffy-ywbk). Required, with no default: the operator chooses it.
/// Null is a node that does no channels — requests, acceptances and
/// payments are refused, while an existing channel can still be closed,
/// expired or refunded.
required ChannelTiming? timing,
}) : _walletManager = walletManager,
_timing = timing,
_spvActor = spvActor,
_storage = storage,
_headerChain = headerChain,
_eventStore = eventStore,
_cryptoService = cryptoService,
_networkType = networkType,
_eventBroadcaster = eventBroadcaster,
_channelProjection = channelProjection,
_arcActor = arcActor,
_walletProjection = walletProjection,
_broadcastTimeout = broadcastTimeout,
_inFlightTimeout = inFlightTimeout,
_inFlightPollInterval = inFlightPollInterval,
_signingTimeout = signingTimeout {
_channelBuilder = const PaymentChannelBuilder();
}