pub trait Policy {
    // Required methods
    fn policy_error(
        &self,
        _tag: String,
        msg: String
    ) -> Result<(), ValidationError>;
    fn temporary_policy_error(
        &self,
        _tag: String,
        msg: String
    ) -> Result<(), ValidationError>;
    fn policy_log(&self, _tag: String, msg: String);
    fn global_velocity_control(&self) -> VelocityControlSpec;
    fn fee_velocity_control(&self) -> VelocityControlSpec;

    // Provided methods
    fn max_channels(&self) -> usize { ... }
    fn max_invoices(&self) -> usize { ... }
}
Expand description

An enforcement policy

Required Methods§

source

fn policy_error(&self, _tag: String, msg: String) -> Result<(), ValidationError>

A policy error has occurred. Policy errors can be converted to warnings by returning Ok(())

source

fn temporary_policy_error( &self, _tag: String, msg: String ) -> Result<(), ValidationError>

A temporary policy error has occurred. Policy errors can be converted to warnings by returning Ok(())

source

fn policy_log(&self, _tag: String, msg: String)

Log at ERROR or WARN matching the policy error handling

source

fn global_velocity_control(&self) -> VelocityControlSpec

Velocity control to apply to the entire node

source

fn fee_velocity_control(&self) -> VelocityControlSpec

Velocity control to apply to L1 fees paid by the node

Provided Methods§

source

fn max_channels(&self) -> usize

Maximum number of concurrent channels

source

fn max_invoices(&self) -> usize

Maximum number of concurrent invoices (issued and approved)

Implementors§