// Background feerate which is <= the minimum Normal feerate.
match conf_target {
ConfirmationTarget::HighPriority => MAX_FEE,
- ConfirmationTarget::Background => 253,
+ ConfirmationTarget::Background|ConfirmationTarget::MempoolMinimum => 253,
ConfirmationTarget::Normal => cmp::min(self.ret_val.load(atomic::Ordering::Acquire), MAX_FEE),
}
}
impl Router for FuzzRouter {
fn find_route(
&self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>,
- _inflight_htlcs: &InFlightHtlcs
+ _inflight_htlcs: InFlightHtlcs
) -> Result<Route, msgs::LightningError> {
Err(msgs::LightningError {
err: String::from("Not implemented"),
// is probably just stale and you should add new messages here.
match err.as_str() {
"Peer for first hop currently disconnected" => {},
- _ if err.starts_with("Cannot push more than their max accepted HTLCs ") => {},
- _ if err.starts_with("Cannot send value that would put us over the max HTLC value in flight our peer will accept ") => {},
- _ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
- _ if err.starts_with("Cannot send value that would put counterparty balance under holder-announced channel reserve value") => {},
- _ if err.starts_with("Cannot send value that would overdraw remaining funds.") => {},
- _ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => {},
- _ if err.starts_with("Cannot send value that would put our exposure to dust HTLCs at") => {},
+ _ if err.starts_with("Cannot send less than our next-HTLC minimum - ") => {},
+ _ if err.starts_with("Cannot send more than our next-HTLC maximum - ") => {},
_ => panic!("{}", err),
}
assert!(sendable_bounds_violated);
config.channel_config.forwarding_fee_proportional_millionths = 0;
config.channel_handshake_config.announced_channel = true;
let network = Network::Bitcoin;
+ let best_block_timestamp = genesis_block(network).header.time;
let params = ChainParameters {
network,
best_block: BestBlock::from_network(network),
};
- (ChannelManager::new($fee_estimator.clone(), monitor.clone(), broadcast.clone(), &router, Arc::clone(&logger), keys_manager.clone(), keys_manager.clone(), keys_manager.clone(), config, params),
+ (ChannelManager::new($fee_estimator.clone(), monitor.clone(), broadcast.clone(), &router, Arc::clone(&logger), keys_manager.clone(), keys_manager.clone(), keys_manager.clone(), config, params, best_block_timestamp),
monitor, keys_manager)
} }
}
let mut channel_txn = Vec::new();
macro_rules! make_channel {
($source: expr, $dest: expr, $chan_id: expr) => { {
- $source.peer_connected(&$dest.get_our_node_id(), &Init { features: $dest.init_features(), remote_network_address: None }, true).unwrap();
- $dest.peer_connected(&$source.get_our_node_id(), &Init { features: $source.init_features(), remote_network_address: None }, false).unwrap();
+ $source.peer_connected(&$dest.get_our_node_id(), &Init {
+ features: $dest.init_features(), networks: None, remote_network_address: None
+ }, true).unwrap();
+ $dest.peer_connected(&$source.get_our_node_id(), &Init {
+ features: $source.init_features(), networks: None, remote_network_address: None
+ }, false).unwrap();
$source.create_channel($dest.get_our_node_id(), 100_000, 42, 0, None).unwrap();
let open_channel = {
},
0x0e => {
if chan_a_disconnected {
- nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, true).unwrap();
- nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init { features: nodes[0].init_features(), remote_network_address: None }, false).unwrap();
+ nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init {
+ features: nodes[1].init_features(), networks: None, remote_network_address: None
+ }, true).unwrap();
+ nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init {
+ features: nodes[0].init_features(), networks: None, remote_network_address: None
+ }, false).unwrap();
chan_a_disconnected = false;
}
},
0x0f => {
if chan_b_disconnected {
- nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init { features: nodes[2].init_features(), remote_network_address: None }, true).unwrap();
- nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, false).unwrap();
+ nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init {
+ features: nodes[2].init_features(), networks: None, remote_network_address: None
+ }, true).unwrap();
+ nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init {
+ features: nodes[1].init_features(), networks: None, remote_network_address: None
+ }, false).unwrap();
chan_b_disconnected = false;
}
},
// Next, make sure peers are all connected to each other
if chan_a_disconnected {
- nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, true).unwrap();
- nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init { features: nodes[0].init_features(), remote_network_address: None }, false).unwrap();
+ nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init {
+ features: nodes[1].init_features(), networks: None, remote_network_address: None
+ }, true).unwrap();
+ nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init {
+ features: nodes[0].init_features(), networks: None, remote_network_address: None
+ }, false).unwrap();
chan_a_disconnected = false;
}
if chan_b_disconnected {
- nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init { features: nodes[2].init_features(), remote_network_address: None }, true).unwrap();
- nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, false).unwrap();
+ nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init {
+ features: nodes[2].init_features(), networks: None, remote_network_address: None
+ }, true).unwrap();
+ nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init {
+ features: nodes[1].init_features(), networks: None, remote_network_address: None
+ }, false).unwrap();
chan_b_disconnected = false;
}