Ejemplo n.º 1
0
 internal static FFIResult new_inbound_connection(
     UIntPtr index,
     SendData sendData,
     DisconnectSocket disconnectSocket,
     PeerManagerHandle handle,
     bool check = true
     ) => MaybeCheck(_new_inbound_connection(index, ref sendData, ref disconnectSocket, handle), check);
Ejemplo n.º 2
0
 internal static FFIResult get_network_graph(
     IntPtr bufOut,
     UIntPtr bufLen,
     out UIntPtr actualLen,
     PeerManagerHandle peerManagerHandle,
     bool check = true
     ) => MaybeCheck(_get_network_graph(bufOut, bufLen, out actualLen, peerManagerHandle), check);
Ejemplo n.º 3
0
        internal static unsafe FFIResult create_peer_manager(
            IntPtr seed,
            UserConfig *userConfig,

            ChannelManagerHandle channelManagerHandle,
            InstallWatchTx installWatchTx,
            InstallWatchOutPoint installWatchOutPoint,
            WatchAllTxn watchAllTxn,
            GetChainUtxo getChainUtxo,
            FilterBlock filterBlock,
            ReEntered reEntered,

            Log log,

            IntPtr ourNodeSecret,
            out PeerManagerHandle handle,
            bool check = true
            ) =>
        MaybeCheck(_create_peer_manager(
                       seed,
                       userConfig,
                       channelManagerHandle,
                       ref installWatchTx,
                       ref installWatchOutPoint,
                       ref watchAllTxn,
                       ref getChainUtxo,
                       ref filterBlock,
                       ref reEntered,

                       ref log,
                       ourNodeSecret,
                       out handle),
                   check);
Ejemplo n.º 4
0
 private static extern unsafe FFIResult _send_non_mpp_payment_with_peer_manager(
     byte *theirNodeIdPtr,
     byte *paymentHashPtr,
     ref FFIBytes lastHopsPtr,
     ulong finalValueMSat,
     uint finalCLTV,
     PeerManagerHandle peerManagerHandle,
     ChannelManagerHandle channelManagerHandle);
Ejemplo n.º 5
0
 private static extern FFIResult _new_outbound_connection(
     UIntPtr index,
     ref SendData sendData,
     ref DisconnectSocket disconnectSocket,
     IntPtr theirNodeId,
     PeerManagerHandle handle,
     out ActOne initialSend
     );
Ejemplo n.º 6
0
 internal static FFIResult new_outbound_connection(
     UIntPtr index,
     SendData sendData,
     DisconnectSocket disconnectSocket,
     IntPtr theirNodeId,
     PeerManagerHandle handle,
     out ActOne initialSend,
     bool check = true
     ) => MaybeCheck(_new_outbound_connection(index, ref sendData, ref disconnectSocket, theirNodeId, handle, out initialSend), check);
Ejemplo n.º 7
0
 internal static unsafe FFIResult send_non_mpp_payment_with_peer_manager(
     byte *theirNodeIdPtr,
     byte *paymentHashPtr,
     ref FFIBytes lastHopsPtr,
     ulong finalValueMSat,
     uint finalCLTV,
     PeerManagerHandle peerManagerHandle,
     ChannelManagerHandle channelManagerHandle,
     bool check = true)
 => MaybeCheckPaymentFailure(_send_non_mpp_payment_with_peer_manager(theirNodeIdPtr, paymentHashPtr, ref lastHopsPtr, finalValueMSat, finalCLTV, peerManagerHandle, channelManagerHandle), check);
Ejemplo n.º 8
0
 internal PeerManager(
     PeerManagerHandle handle,
     ChannelManager channelManager,
     BlockNotifier blockNotifier,
     int tickInterval,
     object[] deps
     )
 {
     _deps          = deps;
     tick           = new Timer(_ => Tick(), null, tickInterval, tickInterval);
     _handle        = handle ?? throw new ArgumentNullException(nameof(handle));
     ChannelManager = channelManager ?? throw new ArgumentNullException(nameof(channelManager));
     BlockNotifier  = blockNotifier ?? throw new ArgumentNullException(nameof(blockNotifier));
 }
Ejemplo n.º 9
0
        private static extern unsafe FFIResult _create_peer_manager(
            IntPtr seedPtr,
            UserConfig *userConfig,

            ChannelManagerHandle channelManagerHandle,
            ref InstallWatchTx installWatchTx,
            ref InstallWatchOutPoint installWatchOutPoint,
            ref WatchAllTxn watchAllTxn,
            ref GetChainUtxo getChainUtxo,
            ref FilterBlock filterBlock,
            ref ReEntered reEntered,

            ref Log log,

            IntPtr ourNodeSecret,
            out PeerManagerHandle handle
            );
Ejemplo n.º 10
0
 private static extern unsafe FFIResult _get_peer_node_ids(byte *bufOut, UIntPtr bufLen, out UIntPtr actualNodeIdsLength, PeerManagerHandle handle);
Ejemplo n.º 11
0
 internal static FFIResult socket_disconnected(UIntPtr index, SendData sendData, DisconnectSocket disconnectSocket, PeerManagerHandle handle, bool check = true) =>
 MaybeCheck(_socket_disconnected(index, ref sendData, ref disconnectSocket, handle), check);
Ejemplo n.º 12
0
 private static extern FFIResult _socket_disconnected(UIntPtr index, ref SendData sendData, ref DisconnectSocket disconnectSocket, PeerManagerHandle handle);
Ejemplo n.º 13
0
 internal static FFIResult process_events(PeerManagerHandle handle, bool check = true)
 => MaybeCheck(_process_events(handle), check);
Ejemplo n.º 14
0
 private static extern FFIResult _process_events(PeerManagerHandle handle);
Ejemplo n.º 15
0
 private static extern FFIResult _write_buffer_space_avail(UIntPtr index, ref SendData sendData, ref DisconnectSocket disconnectSocket, PeerManagerHandle handle);
Ejemplo n.º 16
0
 internal static FFIResult timer_tick_occured(PeerManagerHandle handle, bool check = true) => MaybeCheck(_timer_tick_occured(handle), check);
Ejemplo n.º 17
0
 private static extern FFIResult _timer_tick_occured(PeerManagerHandle handle);
Ejemplo n.º 18
0
 internal static unsafe FFIResult get_peer_node_ids(byte *bufOut, UIntPtr bufLen, out UIntPtr actualNodeIdsLength, PeerManagerHandle handle, bool check = true)
 {
     return(MaybeCheck(_get_peer_node_ids(bufOut, bufLen, out actualNodeIdsLength, handle), check));
 }
Ejemplo n.º 19
0
 private static extern FFIResult _read_event(UIntPtr index, ref SendData sendData, ref DisconnectSocket disconnectSocket, ref FFIBytes data, out byte shouldPause, PeerManagerHandle handle);
Ejemplo n.º 20
0
 private static extern FFIResult _get_network_graph(
     IntPtr bufOut,
     UIntPtr bufLen,
     out UIntPtr actualLen,
     PeerManagerHandle peerManagerHandle
     );
Ejemplo n.º 21
0
 internal static FFIResult read_event(UIntPtr index, SendData sendData,
                                      DisconnectSocket disconnectSocket, ref FFIBytes data, out byte shouldPause, PeerManagerHandle handle, bool check = true)
 => MaybeCheck(_read_event(index, ref sendData, ref disconnectSocket, ref data, out shouldPause, handle), check);
Ejemplo n.º 22
0
 internal static FFIResult write_buffer_space_avail(UIntPtr index, SendData sendData,
                                                    DisconnectSocket disconnectSocket, PeerManagerHandle handle, bool check = true)
 => MaybeCheck(_write_buffer_space_avail(index, ref sendData, ref disconnectSocket, handle), check);
Ejemplo n.º 23
0
 private static extern FFIResult _new_inbound_connection(
     UIntPtr index,
     ref SendData sendData,
     ref DisconnectSocket disconnectSocket,
     PeerManagerHandle handle
     );