@@ -973,8 +973,9 @@ macro_rules! commitment_signed_dance {
973
973
macro_rules! get_payment_preimage_hash {
974
974
( $dest_node: expr) => {
975
975
{
976
- let payment_preimage = PaymentPreimage ( [ * $dest_node. network_payment_count. borrow( ) ; 32 ] ) ;
977
- * $dest_node. network_payment_count. borrow_mut( ) += 1 ;
976
+ let mut payment_count = $dest_node. network_payment_count. borrow_mut( ) ;
977
+ let payment_preimage = PaymentPreimage ( [ * payment_count; 32 ] ) ;
978
+ * payment_count += 1 ;
978
979
let payment_hash = PaymentHash ( Sha256 :: hash( & payment_preimage. 0 [ ..] ) . into_inner( ) ) ;
979
980
let payment_secret = $dest_node. node. create_inbound_payment_for_hash( payment_hash, None , 7200 , 0 ) . unwrap( ) ;
980
981
( payment_preimage, payment_hash, payment_secret)
@@ -989,7 +990,9 @@ macro_rules! get_route_and_payment_hash {
989
990
let net_graph_msg_handler = & $send_node. net_graph_msg_handler;
990
991
let route = get_route( & $send_node. node. get_our_node_id( ) ,
991
992
& net_graph_msg_handler. network_graph,
992
- & $recv_node. node. get_our_node_id( ) , None , None , & Vec :: new( ) , $recv_value, TEST_FINAL_CLTV , $send_node. logger) . unwrap( ) ;
993
+ & $recv_node. node. get_our_node_id( ) , None ,
994
+ Some ( & $send_node. node. list_usable_channels( ) . iter( ) . map( |a| a) . collect:: <Vec <_>>( ) ) ,
995
+ & Vec :: new( ) , $recv_value, TEST_FINAL_CLTV , $send_node. logger) . unwrap( ) ;
993
996
( route, payment_hash, payment_preimage, payment_secret)
994
997
} }
995
998
}
0 commit comments