projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb7d0f2
)
fix bunk test
2022-01-bunk-test-for-jeff
author
Matt Corallo
<git@bluematt.me>
Tue, 25 Jan 2022 19:59:15 +0000
(19:59 +0000)
committer
Matt Corallo
<git@bluematt.me>
Tue, 25 Jan 2022 19:59:15 +0000
(19:59 +0000)
lightning/src/routing/router.rs
patch
|
blob
|
history
diff --git
a/lightning/src/routing/router.rs
b/lightning/src/routing/router.rs
index 3c682c0ea7452354850f36ce353ed058735aae47..614641d6016be076f3079d866d21a390fdf83c99 100644
(file)
--- a/
lightning/src/routing/router.rs
+++ b/
lightning/src/routing/router.rs
@@
-4724,10
+4724,25
@@
mod tests {
#[test]
fn prefers_shorter_route_with_higher_fees() {
#[test]
fn prefers_shorter_route_with_higher_fees() {
- let (secp_ctx, network_graph,
_
, _, logger) = build_graph();
- let (
_
, our_id, _, nodes) = get_nodes(&secp_ctx);
+ let (secp_ctx, network_graph,
net_graph_msg_handler
, _, logger) = build_graph();
+ let (
our_privkey
, our_id, _, nodes) = get_nodes(&secp_ctx);
let payee = Payee::from_node_id(nodes[6]).with_route_hints(last_hops(&nodes));
let payee = Payee::from_node_id(nodes[6]).with_route_hints(last_hops(&nodes));
+
+ update_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
+ short_channel_id: 2,
+ timestamp: 1,
+ flags: 0,
+ cltv_expiry_delta: (5 << 4) | 3,
+ htlc_minimum_msat: 0,
+ htlc_maximum_msat: OptionalField::Absent,
+ fee_base_msat: 0,
+ fee_proportional_millionths: u32::max_value(),
+ excess_data: Vec::new()
+ });
+
+
// Without penalizing each hop 100 msats, a longer path with lower fees is chosen.
let scorer = test_utils::TestScorer::with_penalty(0);
let route = get_route(
// Without penalizing each hop 100 msats, a longer path with lower fees is chosen.
let scorer = test_utils::TestScorer::with_penalty(0);
let route = get_route(