[[package]]
name = "lightning"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1"
+checksum = "5fd92d4aa159374be430c7590e169b4a6c0fb79018f5bc4ea1bffde536384db3"
dependencies = [
"bitcoin",
"hex-conservative",
[[package]]
name = "lightning-background-processor"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57d4711ad9cc33f30c2e8e876fcfd6255523fc250440abb8c374cd98e6c40e79"
+checksum = "fb1c2c64050e37cee7c3b6b022106523784055ac3ee572d360780a1d6fe8062c"
dependencies = [
"bitcoin",
"lightning",
[[package]]
name = "lightning-block-sync"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcb75d3aca909b77ee21b2e26714c370bdc3246734fa3d4355afa503cb3c0feb"
+checksum = "61e1e70fa351daccede0c366cf16320b16a3e42b05ae3c7ec9c0df6b5d3a3e18"
dependencies = [
"bitcoin",
"chunked_transfer",
[[package]]
name = "lightning-invoice"
-version = "0.29.0"
+version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04"
+checksum = "26d07d01cf197bf2184b929b7dc94aa70d935aac6df896c256a3a9475b7e9d40"
dependencies = [
"bech32 0.9.1",
"bitcoin",
"lightning",
- "num-traits",
"secp256k1",
]
[[package]]
name = "lightning-net-tokio"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4813cca14ed984924a6975895e80cde8673a0a105a1c7ddf3b0fb3d1ce59e6bf"
+checksum = "f9e6a4d49c50a1344916d080dc8c012ce3a778cdd45de8def75350b2b40fe018"
dependencies = [
"bitcoin",
"lightning",
[[package]]
name = "lightning-persister"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a82a633e4d08b75e16dc131af2961254b7005c30ab29577e215080d2943c0511"
+checksum = "8a8dd33971815fa074b05678e09a6d4b15c78225ea34d66ed4f17c35a53467a9"
dependencies = [
"bitcoin",
"lightning",
[[package]]
name = "lightning-rapid-gossip-sync"
-version = "0.0.121"
+version = "0.0.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "128d6c450cb698b46ecacc6645ebeb2b57d6f9458482635ab523863fa8378314"
+checksum = "9d861b0f0cd5f8fe8c63760023c4fd4fd32c384881b41780b62ced2a8a619f91"
dependencies = [
"bitcoin",
"lightning",
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-lightning = { version = "0.0.121", features = ["max_level_trace"] }
-lightning-block-sync = { version = "0.0.121", features = [ "rpc-client", "tokio" ] }
-lightning-invoice = { version = "0.29.0" }
-lightning-net-tokio = { version = "0.0.121" }
-lightning-persister = { version = "0.0.121" }
-lightning-background-processor = { version = "0.0.121", features = [ "futures" ] }
-lightning-rapid-gossip-sync = { version = "0.0.121" }
+lightning = { version = "0.0.123", features = ["max_level_trace"] }
+lightning-block-sync = { version = "0.0.123", features = [ "rpc-client", "tokio" ] }
+lightning-invoice = { version = "0.31.0" }
+lightning-net-tokio = { version = "0.0.123" }
+lightning-persister = { version = "0.0.123" }
+lightning-background-processor = { version = "0.0.123", features = [ "futures" ] }
+lightning-rapid-gossip-sync = { version = "0.0.123" }
base64 = "0.13.0"
bitcoin = "0.30.2"
);
},
"getoffer" => {
- let offer_builder = channel_manager.create_offer_builder(String::new());
+ let offer_builder = channel_manager.create_offer_builder();
if let Err(e) = offer_builder {
println!("ERROR: Failed to initiate offer building: {:?}", e);
continue;
println!("\t\t num_usable_channels: {}", chans.iter().filter(|c| c.is_usable).count());
let local_balance_msat = chans.iter().map(|c| c.balance_msat).sum::<u64>();
println!("\t\t local_balance_msat: {}", local_balance_msat);
- println!("\t\t num_peers: {}", peer_manager.get_peer_node_ids().len());
+ println!("\t\t num_peers: {}", peer_manager.list_peers().len());
println!("\t}},");
}
fn list_peers(peer_manager: Arc<PeerManager>) {
println!("\t{{");
- for (pubkey, _) in peer_manager.get_peer_node_ids() {
- println!("\t\t pubkey: {}", pubkey);
+ for peer_details in peer_manager.list_peers() {
+ println!("\t\t pubkey: {}", peer_details.counterparty_node_id);
}
println!("\t}},");
}
pub(crate) async fn connect_peer_if_necessary(
pubkey: PublicKey, peer_addr: SocketAddr, peer_manager: Arc<PeerManager>,
) -> Result<(), ()> {
- for (node_pubkey, _) in peer_manager.get_peer_node_ids() {
- if node_pubkey == pubkey {
+ for peer_details in peer_manager.list_peers() {
+ if peer_details.counterparty_node_id == pubkey {
return Ok(());
}
}
_ = &mut connection_closed_future => return Err(()),
_ = tokio::time::sleep(Duration::from_millis(10)) => {},
};
- if peer_manager.get_peer_node_ids().iter().find(|(id, _)| *id == pubkey).is_some() {
+ if peer_manager.peer_by_node_id(&pubkey).is_some() {
return Ok(());
}
}
}
//check the pubkey matches a valid connected peer
- let peers = peer_manager.get_peer_node_ids();
- if !peers.iter().any(|(pk, _)| &pubkey == pk) {
+ if peer_manager.peer_by_node_id(&pubkey).is_none() {
println!("Error: Could not find peer {}", pubkey);
return Err(());
}
print!("> ");
io::stdout().flush().unwrap();
let payment_preimage = match purpose {
- PaymentPurpose::InvoicePayment { payment_preimage, .. } => payment_preimage,
+ PaymentPurpose::Bolt11InvoicePayment { payment_preimage, .. } => payment_preimage,
+ PaymentPurpose::Bolt12OfferPayment { payment_preimage, .. } => payment_preimage,
+ PaymentPurpose::Bolt12RefundPayment { payment_preimage, .. } => payment_preimage,
PaymentPurpose::SpontaneousPayment(preimage) => Some(preimage),
};
channel_manager.claim_funds(payment_preimage.unwrap());
print!("> ");
io::stdout().flush().unwrap();
let (payment_preimage, payment_secret) = match purpose {
- PaymentPurpose::InvoicePayment { payment_preimage, payment_secret, .. } => {
+ PaymentPurpose::Bolt11InvoicePayment {
+ payment_preimage, payment_secret, ..
+ } => (payment_preimage, Some(payment_secret)),
+ PaymentPurpose::Bolt12OfferPayment { payment_preimage, payment_secret, .. } => {
(payment_preimage, Some(payment_secret))
},
+ PaymentPurpose::Bolt12RefundPayment {
+ payment_preimage, payment_secret, ..
+ } => (payment_preimage, Some(payment_secret)),
PaymentPurpose::SpontaneousPayment(preimage) => (Some(preimage), None),
};
let mut inbound = inbound_payments.lock().unwrap();
Event::PaymentForwarded {
prev_channel_id,
next_channel_id,
- fee_earned_msat,
+ total_fee_earned_msat,
claim_from_onchain_tx,
outbound_amount_forwarded_msat,
+ skimmed_fee_msat: _,
+ prev_user_channel_id: _,
+ next_user_channel_id: _,
} => {
let read_only_network_graph = network_graph.read_only();
let nodes = read_only_network_graph.nodes();
} else {
"?".to_string()
};
- if let Some(fee_earned) = fee_earned_msat {
+ if let Some(fee_earned) = total_fee_earned_msat {
println!(
"\nEVENT: Forwarded payment for {} msat{}{}, earning {} msat {}",
amt_args, from_prev_str, to_next_str, fee_earned, from_onchain_str
let router = Arc::new(DefaultRouter::new(
network_graph.clone(),
logger.clone(),
- keys_manager.get_secure_random_bytes(),
+ keys_manager.clone(),
scorer.clone(),
scoring_fee_params,
));
restarting_node = false;
let polled_best_block = polled_chain_tip.to_best_block();
- let polled_best_block_hash = polled_best_block.block_hash();
+ let polled_best_block_hash = polled_best_block.block_hash;
let chain_params =
ChainParameters { network: args.network, best_block: polled_best_block };
let fresh_channel_manager = channelmanager::ChannelManager::new(
Arc::clone(&keys_manager),
Arc::clone(&keys_manager),
Arc::clone(&logger),
- Arc::new(DefaultMessageRouter::new(Arc::clone(&network_graph))),
+ Arc::clone(&channel_manager),
+ Arc::new(DefaultMessageRouter::new(Arc::clone(&network_graph), Arc::clone(&keys_manager))),
Arc::clone(&channel_manager),
IgnoringMessageHandler {},
));
interval.tick().await;
match disk::read_channel_peer_data(Path::new(&peer_data_path)) {
Ok(info) => {
- let peers = connect_pm.get_peer_node_ids();
for node_id in connect_cm
.list_channels()
.iter()
.map(|chan| chan.counterparty.node_id)
- .filter(|id| !peers.iter().any(|(pk, _)| id == pk))
+ .filter(|id| connect_pm.peer_by_node_id(id).is_none())
{
if stop_connect.load(Ordering::Acquire) {
return;
use std::{fs, io};
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
-use lightning::sign::{EntropySource, KeysManager, SpendableOutputDescriptor};
+use lightning::sign::{EntropySource, KeysManager, OutputSpender, SpendableOutputDescriptor};
use lightning::util::logger::Logger;
use lightning::util::persist::KVStore;
use lightning::util::ser::{Readable, WithoutLength, Writeable};
// e.g. high-latency mix networks and some CoinJoin implementations, have
// better privacy.
// Logic copied from core: https://github.com/bitcoin/bitcoin/blob/1d4846a8443be901b8a5deb0e357481af22838d0/src/wallet/spend.cpp#L936
- let mut cur_height = channel_manager.current_best_block().height();
+ let mut cur_height = channel_manager.current_best_block().height;
// 10% of the time
if thread_rng().gen_range(0, 10) == 0 {