Skip to content

Commit efcb3b7

Browse files
committed
f Update to a pre-rebase version branch of tx-sync
1 parent b8eb185 commit efcb3b7

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ description = "A ready-to-go node implementation based on LDK."
2222
#lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main" }
2323
#lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main" }
2424
#lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main" }
25-
26-
lightning = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate", features = ["max_level_trace", "std"] }
27-
lightning-invoice = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate" }
28-
lightning-net-tokio = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate" }
29-
lightning-persister = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate" }
30-
lightning-background-processor = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate" }
31-
lightning-rapid-gossip-sync = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate" }
32-
lightning-transaction-sync = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate", features = ["esplora-async"] }
25+
#lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["esplora-async"] }
26+
27+
lightning = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase", features = ["max_level_trace", "std"] }
28+
lightning-invoice = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase" }
29+
lightning-net-tokio = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase" }
30+
lightning-persister = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase" }
31+
lightning-background-processor = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase" }
32+
lightning-rapid-gossip-sync = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase" }
33+
lightning-transaction-sync = { git = "https://github.com/tnull/rust-lightning", branch="2022-11-add-transaction-sync-crate-pre-rebase", features = ["esplora-async"] }
3334

3435
#lightning = { path = "../rust-lightning/lightning", features = ["max_level_trace", "std"] }
3536
#lightning-invoice = { path = "../rust-lightning/lightning-invoice" }

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,11 @@ impl Builder {
366366
.expect("System time error: Clock may have gone backwards");
367367
let peer_manager: Arc<PeerManager> = Arc::new(PeerManager::new(
368368
lightning_msg_handler,
369-
keys_manager.get_node_secret(Recipient::Node).unwrap(),
370369
cur_time.as_secs().try_into().expect("System time error"),
371370
&ephemeral_bytes,
372371
Arc::clone(&logger),
373372
IgnoringMessageHandler {},
373+
Arc::clone(&keys_manager),
374374
));
375375

376376
// Step 13: Init payment info storage
@@ -945,6 +945,7 @@ impl Node {
945945
amount_msat,
946946
description.to_string(),
947947
expiry_secs,
948+
None,
948949
) {
949950
Ok(inv) => {
950951
log_info!(self.logger, "Invoice created: {}", inv);

src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub(crate) type PeerManager = lightning::ln::peer_handler::PeerManager<
6060
Arc<OnionMessenger>,
6161
Arc<FilesystemLogger>,
6262
IgnoringMessageHandler,
63+
Arc<WalletKeysManager<bdk::sled::Tree>>,
6364
>;
6465

6566
pub(crate) type ChannelManager = lightning::ln::channelmanager::ChannelManager<

src/wallet.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use lightning::chain::keysinterface::{
1212
EntropySource, InMemorySigner, KeyMaterial, KeysManager, NodeSigner, Recipient, SignerProvider,
1313
SpendableOutputDescriptor,
1414
};
15-
use lightning::ln::msgs::DecodeError;
15+
use lightning::ln::msgs::{DecodeError, UnsignedGossipMessage};
1616
use lightning::ln::script::ShutdownScript;
1717

1818
use bdk::blockchain::{Blockchain, EsploraBlockchain};
@@ -22,8 +22,8 @@ use bdk::{FeeRate, SignOptions, SyncOptions};
2222

2323
use bitcoin::bech32::u5;
2424
use bitcoin::secp256k1::ecdh::SharedSecret;
25-
use bitcoin::secp256k1::ecdsa::RecoverableSignature;
26-
use bitcoin::secp256k1::{PublicKey, Scalar, Secp256k1, SecretKey, Signing};
25+
use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
26+
use bitcoin::secp256k1::{PublicKey, Scalar, Secp256k1, Signing};
2727
use bitcoin::{Script, Transaction, TxOut};
2828

2929
use std::collections::HashMap;
@@ -271,10 +271,6 @@ impl<D> NodeSigner for WalletKeysManager<D>
271271
where
272272
D: BatchDatabase,
273273
{
274-
fn get_node_secret(&self, recipient: Recipient) -> Result<SecretKey, ()> {
275-
self.inner.get_node_secret(recipient)
276-
}
277-
278274
fn get_node_id(&self, recipient: Recipient) -> Result<PublicKey, ()> {
279275
self.inner.get_node_id(recipient)
280276
}
@@ -294,6 +290,10 @@ where
294290
) -> Result<RecoverableSignature, ()> {
295291
self.inner.sign_invoice(hrp_bytes, invoice_data, recipient)
296292
}
293+
294+
fn sign_gossip_message(&self, msg: UnsignedGossipMessage<'_>) -> Result<Signature, ()> {
295+
self.inner.sign_gossip_message(msg)
296+
}
297297
}
298298

299299
impl<D> EntropySource for WalletKeysManager<D>

0 commit comments

Comments
 (0)