Skip to content
Merged
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
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ nigiri = []
[dependencies]
aes = "0.8.1"
bdk = { version = "0.23.0", features = ["keys-bip39"] }
bitcoin = "0.28.1"
bitcoin = "0.29.1"
cbc = "0.1.2"
cipher = { version = "0.4.3", features = ["block-padding", "alloc"] }
futures = "0.3.24"
lightning = { version = "0.0.110", features = ["max_level_trace"] }
lightning-background-processor = "0.0.110"
lightning-net-tokio = "0.0.110"
lightning-rapid-gossip-sync = "0.0.110"
lightning = { version = "0.0.111", features = ["max_level_trace"] }
lightning-background-processor = "0.0.111"
lightning-net-tokio = "0.0.111"
lightning-rapid-gossip-sync = "0.0.111"
log = "0.4.17"
rand = "0.8.5"
thiserror = "1.0.34"
Expand Down
8 changes: 4 additions & 4 deletions src/encryption.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::errors::RuntimeError;

use aes::cipher::{block_padding::Pkcs7, BlockEncryptMut, BlockSizeUser, KeyIvInit};
use bdk::bitcoin::secp256k1::rand::thread_rng;
use bdk::bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use bitcoin::hashes::{sha256, sha512, Hash, HashEngine, Hmac, HmacEngine};
use bitcoin::secp256k1::rand::thread_rng;
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use rand::rngs::OsRng;
use rand::RngCore;

Expand Down Expand Up @@ -108,7 +108,7 @@ mod test {
#[test]
fn test_generate_shared_secret() {
let secp = Secp256k1::new();
let ephemeral = bitcoin::secp256k1::ONE_KEY;
let ephemeral = bdk::bitcoin::secp256k1::ONE_KEY;
let ephemeral_pubkey = PublicKey::from_secret_key(&secp, &ephemeral);
let privkey =
Vec::from_hex("6afa9046a9579cad143a384c1b564b9a250d27d6f6a63f9f20bf3a7594c9e2c6")
Expand Down Expand Up @@ -169,7 +169,7 @@ mod test {
// Tested against Decrypt() from btcsuite/btcd
// https://github.com/btcsuite/btcd/blob/v0.22/btcec/ciphering.go#L121
let secp = Secp256k1::new();
let ephemeral = bitcoin::secp256k1::ONE_KEY;
let ephemeral = bdk::bitcoin::secp256k1::ONE_KEY;
let ephemeral_pubkey = PublicKey::from_secret_key(&secp, &ephemeral);
let init_vector = Vec::from_hex("6afa9046a9579cad143a384c1b564b9a").unwrap();
let randomness = Randomness {
Expand Down
9 changes: 2 additions & 7 deletions src/filter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bitcoin::{Script, Transaction, Txid};
use bitcoin::{Script, Txid};
use lightning::chain::{Filter, WatchedOutput};
use std::sync::Mutex;

Expand Down Expand Up @@ -43,13 +43,8 @@ impl Filter for FilterImpl {
.push((*txid, script_pubkey.clone()));
}

fn register_output(&self, output: WatchedOutput) -> Option<(usize, Transaction)> {
fn register_output(&self, output: WatchedOutput) {
self.data.lock().unwrap().outputs.push(output);
// The Filter::register_output return value has been removed, as it was very difficult to
// correctly implement (i.e., without blocking). Users previously using it should instead
// pass dependent transactions in via additional chain::Confirm::transactions_confirmed
// calls (#1663).
None
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ use lightning::chain::channelmonitor::ChannelMonitor;
use lightning::chain::keysinterface::{InMemorySigner, KeysInterface, KeysManager, Recipient};
use lightning::chain::{BestBlock, Watch};
use lightning::ln::channelmanager::ChainParameters;
use lightning::ln::peer_handler::IgnoringMessageHandler;
use lightning::routing::gossip::NetworkGraph;
use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters};
use lightning::util::config::UserConfig;
use lightning_background_processor::{BackgroundProcessor, GossipSync};
use lightning_rapid_gossip_sync::RapidGossipSync;
use log::{debug, error, warn, Level as LogLevel};
use std::sync::{Arc, Mutex};
use std::time::{SystemTime, UNIX_EPOCH};
use tokio::task::JoinHandle;
use tokio::time::{Duration, Instant};

Expand Down Expand Up @@ -333,7 +335,12 @@ fn init_peer_manager(
})?;
Ok(PeerManager::new_channel_only(
channel_manager,
IgnoringMessageHandler {},
our_node_secret,
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs(),
&ephemeral_bytes,
logger,
))
Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) type PeerManager = lightning::ln::peer_handler::PeerManager<
SocketDescriptor,
Arc<ChannelManager>,
IgnoringMessageHandler,
IgnoringMessageHandler,
Arc<LightningLogger>,
IgnoringMessageHandler,
>;