Skip to content

Async KV Store #3778

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion lightning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"]
[features]
# Internal test utilities exposed to other repo crates
_test_utils = ["regex", "bitcoin/bitcoinconsensus", "lightning-types/_test_utils"]
_externalize_tests = ["inventory", "_test_utils"]
_externalize_tests = ["inventory", "_test_utils", "tokio"]
# Allow signing of local transactions that may have been revoked or will be revoked, for functional testing (e.g. justice tx handling).
# This is unsafe to use in production because it may result in the counterparty publishing taking our funds.
unsafe_revoked_tx_signing = []
Expand Down Expand Up @@ -48,12 +48,14 @@ backtrace = { version = "0.3", optional = true }

libm = { version = "0.2", default-features = false }
inventory = { version = "0.3", optional = true }
tokio = { version = "1.35", features = [ "macros", "rt" ], optional = true }

[dev-dependencies]
regex = "1.5.6"
lightning-types = { version = "0.3.0", path = "../lightning-types", features = ["_test_utils"] }
lightning-macros = { path = "../lightning-macros" }
parking_lot = { version = "0.12", default-features = false }
tokio = { version = "1.35", features = [ "macros", "rt" ] }

[dev-dependencies.bitcoin]
version = "0.32.2"
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/chain/chainmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use crate::chain::transaction::{OutPoint, TransactionData};
use crate::ln::types::ChannelId;
use crate::sign::ecdsa::EcdsaChannelSigner;
use crate::events::{self, Event, EventHandler, ReplayEvent};
use crate::util::async_poll::{AsyncResult, AsyncResultNo};
use crate::util::logger::{Logger, WithContext};
use crate::util::errors::APIError;
use crate::util::persist::MonitorName;
Expand Down Expand Up @@ -171,7 +172,7 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
/// the archive process. Additionally, because the archive operation could be retried on
/// restart, this method must in that case be idempotent, ensuring it can handle scenarios where
/// the monitor already exists in the archive.
fn archive_persisted_channel(&self, monitor_name: MonitorName);
fn archive_persisted_channel<'a>(&'a self, monitor_name: MonitorName) -> AsyncResultNo<'a>;
}

struct MonitorHolder<ChannelSigner: EcdsaChannelSigner> {
Expand Down Expand Up @@ -1136,4 +1137,3 @@ mod tests {
}).is_err());
}
}

Loading