Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MempoolInterface to add mempool scan #2404

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions lightning/src/chain/mempoolinterface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may not use this file except in accordance with one or both of these
// licenses.

//! Traits and utility impls which allow other parts of rust-lightning to
//! interact with the mempool.
//!
//! Includes traits for monitoring and receiving notification for in-mempool
//! descendants of a channel output.

use crate::chain::transaction::OutPoint;

use bitcoin::blockdata::transaction::Transaction;

pub enum MempoolWatchStatus {
/// The in-mempool descendant of the watched outpoint.
DescendantTx(Transaction)
/// The watch outpoint has been reorged out of the chain.
Reorg,
}

/// An interface to monitor a local cacche of Bitcoin transacations waiting
/// confirmations.
pub trait MempoolInterface {
fn watch_outpoint(&self, funding_txo: OutPoint) -> MempoolWatchStatus;
}