[dependencies]
bitcoin = "0.29"
-lightning = { version = "0.0.117" }
-lightning-block-sync = { version = "0.0.117", features=["rest-client"] }
-lightning-net-tokio = { version = "0.0.117" }
+lightning = { version = "0.0.118" }
+lightning-block-sync = { version = "0.0.118", features=["rest-client"] }
+lightning-net-tokio = { version = "0.0.118" }
tokio = { version = "1.25", features = ["full"] }
tokio-postgres = { version = "=0.7.5" }
futures = "0.3"
[dev-dependencies]
-lightning = { version = "0.0.117", features = ["_test_utils"] }
-lightning-rapid-gossip-sync = { version = "0.0.117" }
+lightning = { version = "0.0.118", features = ["_test_utils"] }
+lightning-rapid-gossip-sync = { version = "0.0.118" }
[profile.dev]
panic = "abort"
use std::io::BufReader;
use std::ops::Deref;
use std::sync::Arc;
+use bitcoin::blockdata::constants::ChainHash;
use lightning::log_info;
use lightning::routing::gossip::{NetworkGraph, NodeId};
let mut blob = GOSSIP_PREFIX.to_vec();
let network = config::network();
- let genesis_block = bitcoin::blockdata::constants::genesis_block(network);
- let chain_hash = genesis_block.block_hash();
+ let chain_hash = ChainHash::using_genesis_block(network);
chain_hash.write(&mut blob).unwrap();
let blob_timestamp = Snapshotter::<Arc<RGSSLogger>>::round_down_to_nearest_multiple(current_timestamp, SYMLINK_GRANULARITY_INTERVAL as u64) as u32;
use std::collections::HashMap;
use std::time::{SystemTime, UNIX_EPOCH};
-use bitcoin::BlockHash;
-use bitcoin::hashes::Hash;
+use bitcoin::Network;
+use bitcoin::blockdata::constants::ChainHash;
use lightning::ln::msgs::{UnsignedChannelAnnouncement, UnsignedChannelUpdate};
use lightning::util::ser::{BigSize, Writeable};
use crate::config;
pub(super) updates: Vec<UpdateSerialization>,
pub(super) full_update_defaults: DefaultUpdateValues,
pub(super) latest_seen: u32,
- pub(super) chain_hash: BlockHash,
+ pub(super) chain_hash: ChainHash,
}
pub(super) struct DefaultUpdateValues {
announcements: vec![],
updates: vec![],
full_update_defaults: Default::default(),
- chain_hash: BlockHash::all_zeros(),
+ chain_hash: ChainHash::using_genesis_block(Network::Bitcoin),
latest_seen: 0,
};
let channel_announcement_delta = channel_delta.announcement.as_ref().unwrap();
if !chain_hash_set {
chain_hash_set = true;
- serialization_set.chain_hash = channel_announcement_delta.announcement.chain_hash.clone();
+ serialization_set.chain_hash = channel_announcement_delta.announcement.chain_hash;
}
let current_announcement_seen = channel_announcement_delta.seen;
use std::sync::Arc;
use std::{fs, thread};
use std::time::{SystemTime, UNIX_EPOCH};
-use bitcoin::{BlockHash, Network};
+use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::Network;
use bitcoin::secp256k1::ecdsa::Signature;
use bitcoin::secp256k1::{Secp256k1, SecretKey};
use bitcoin::hashes::Hash;
Signature::from_compact(&[0u8; 64]).unwrap()
}
-fn genesis_hash() -> BlockHash {
- bitcoin::blockdata::constants::genesis_block(Network::Bitcoin).block_hash()
+fn genesis_hash() -> ChainHash {
+ ChainHash::using_genesis_block(Network::Bitcoin)
}
fn current_time() -> u32 {
use std::sync::Arc;
use std::sync::Mutex;
+use bitcoin::blockdata::constants::ChainHash;
use bitcoin::{BlockHash, TxOut};
use bitcoin::blockdata::block::Block;
use bitcoin::hashes::Hash;
}
impl<L: Deref + Clone + Send + Sync + 'static> UtxoLookup for ChainVerifier<L> where L::Target: Logger {
- fn get_utxo(&self, _genesis_hash: &BlockHash, short_channel_id: u64) -> UtxoResult {
+ fn get_utxo(&self, _genesis_hash: &ChainHash, short_channel_id: u64) -> UtxoResult {
let res = UtxoFuture::new();
let fut = res.clone();
let graph_ref = Arc::clone(&self.graph);