File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ interface Node {
126126 NetworkGraph network_graph();
127127 string sign_message([ByRef]sequence<u8> msg);
128128 boolean verify_signature([ByRef]sequence<u8> msg, [ByRef]string sig, [ByRef]PublicKey pkey);
129+ [Throws=NodeError]
130+ bytes export_pathfinding_scores();
129131};
130132
131133[Enum]
Original file line number Diff line number Diff line change @@ -99,8 +99,6 @@ mod wallet;
9999pub use bip39;
100100pub use bitcoin;
101101pub use lightning;
102- pub use lightning_invoice;
103- pub use lightning_types;
104102pub use vss_client;
105103
106104pub use balance:: { BalanceDetails , LightningBalance , PendingSweepBalance } ;
@@ -1509,6 +1507,21 @@ impl Node {
15091507 pub fn verify_signature ( & self , msg : & [ u8 ] , sig : & str , pkey : & PublicKey ) -> bool {
15101508 self . keys_manager . verify_signature ( msg, sig, pkey)
15111509 }
1510+
1511+ /// Exports the current state of the scorer. The result can be shared with and merged by light nodes that only have
1512+ /// a limited view of the network.
1513+ pub fn export_pathfinding_scores ( & self ) -> Result < Vec < u8 > , Error > {
1514+ self . kv_store
1515+ . read (
1516+ lightning:: util:: persist:: SCORER_PERSISTENCE_PRIMARY_NAMESPACE ,
1517+ lightning:: util:: persist:: SCORER_PERSISTENCE_SECONDARY_NAMESPACE ,
1518+ lightning:: util:: persist:: SCORER_PERSISTENCE_KEY ,
1519+ )
1520+ . map_err ( |e| {
1521+ log_error ! ( self . logger, "Failed to export pathfinding scores: {}" , e) ;
1522+ Error :: PersistenceFailed
1523+ } )
1524+ }
15121525}
15131526
15141527impl Drop for Node {
You can’t perform that action at this time.
0 commit comments