pub struct GossipVerifier<S: FutureSpawner, Blocks: Deref + Send + Sync + 'static + Clone, L: Deref + Send + Sync + 'static>
where Blocks::Target: UtxoSource, L::Target: Logger,
{ /* private fields */ }
Expand description

A struct which wraps a UtxoSource and a few LDK objects and implements the LDK UtxoLookup trait.

Note that if you’re using this against a Bitcoin Core REST or RPC server, you likely wish to increase the rpcworkqueue setting in Bitcoin Core as LDK attempts to parallelize requests (a value of 1024 should more than suffice), and ensure you have sufficient file descriptors available on both Bitcoin Core and your LDK application for each request to hold its own connection.

Implementations§

source§

impl<S: FutureSpawner, Blocks: Deref + Send + Sync + Clone, L: Deref + Send + Sync> GossipVerifier<S, Blocks, L>
where Blocks::Target: UtxoSource, L::Target: Logger,

source

pub fn new<APM: Deref + Send + Sync + Clone + 'static>( source: Blocks, spawn: S, gossiper: Arc<P2PGossipSync<Arc<NetworkGraph<L>>, Self, L>>, peer_manager: APM ) -> Self
where APM::Target: APeerManager,

Constructs a new GossipVerifier.

This is expected to be given to a P2PGossipSync (initially constructed with None for the UTXO lookup) via P2PGossipSync::add_utxo_lookup.

Trait Implementations§

source§

impl<S: FutureSpawner, Blocks: Deref + Send + Sync + Clone, L: Deref + Send + Sync> Deref for GossipVerifier<S, Blocks, L>
where Blocks::Target: UtxoSource, L::Target: Logger,

§

type Target = GossipVerifier<S, Blocks, L>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self

Dereferences the value.
source§

impl<S: FutureSpawner, Blocks: Deref + Send + Sync + Clone, L: Deref + Send + Sync> UtxoLookup for GossipVerifier<S, Blocks, L>
where Blocks::Target: UtxoSource, L::Target: Logger,

source§

fn get_utxo(&self, _chain_hash: &ChainHash, short_channel_id: u64) -> UtxoResult

Returns the transaction output of a funding transaction encoded by short_channel_id. Returns an error if chain_hash is for a different chain or if such a transaction output is unknown.

Auto Trait Implementations§

§

impl<S, Blocks, L> Freeze for GossipVerifier<S, Blocks, L>
where <Blocks as Deref>::Target: BlockSource + Send + Sync + 'static, S: Sync + Send + 'static + Freeze, Blocks: Freeze,

§

impl<S, Blocks, L> !RefUnwindSafe for GossipVerifier<S, Blocks, L>

§

impl<S, Blocks, L> Send for GossipVerifier<S, Blocks, L>
where <Blocks as Deref>::Target: BlockSource + Send + Sync + 'static, S: Sync + Send + 'static,

§

impl<S, Blocks, L> Sync for GossipVerifier<S, Blocks, L>
where <Blocks as Deref>::Target: BlockSource + Send + Sync + 'static, S: Sync + Send + 'static,

§

impl<S, Blocks, L> Unpin for GossipVerifier<S, Blocks, L>
where <Blocks as Deref>::Target: BlockSource + Send + Sync + 'static, S: Sync + Send + 'static + Unpin, Blocks: Unpin,

§

impl<S, Blocks, L> !UnwindSafe for GossipVerifier<S, Blocks, L>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<S, T> ScoreLookUp for T
where S: ScoreLookUp, T: Deref<Target = S>,

§

type ScoreParams = <S as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
source§

fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &<T as ScoreLookUp>::ScoreParams ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.