@@ -35,7 +35,7 @@ use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
35
35
use chain:: channelmonitor:: { ChannelMonitor , ChannelMonitorUpdate , ChannelMonitorUpdateStep , LATENCY_GRACE_PERIOD_BLOCKS } ;
36
36
use chain:: transaction:: { OutPoint , TransactionData } ;
37
37
use chain:: keysinterface:: { Sign , KeysInterface } ;
38
- use util:: events:: ClosureReason ;
38
+ use util:: events:: { ClosureReason , HTLCDestination } ;
39
39
use util:: ser:: { Readable , ReadableArgs , Writeable , Writer , VecWriter } ;
40
40
use util:: logger:: Logger ;
41
41
use util:: errors:: APIError ;
@@ -46,7 +46,6 @@ use io;
46
46
use prelude:: * ;
47
47
use core:: { cmp, mem, fmt} ;
48
48
use core:: ops:: Deref ;
49
- use io:: Error ;
50
49
#[ cfg( any( test, fuzzing, debug_assertions) ) ]
51
50
use sync:: Mutex ;
52
51
use bitcoin:: hashes:: hex:: ToHex ;
@@ -805,36 +804,6 @@ impl fmt::Debug for ChannelError {
805
804
}
806
805
}
807
806
808
- /// Used to return destination of where we are forwarding our HTLC to.
809
- #[ derive( Clone , Debug ) ]
810
- pub enum HTLCDestination {
811
- OpenChannel { node_id : PublicKey , channel_id : [ u8 ; 32 ] } ,
812
- Unknown { previous_hop_scid : u64 } ,
813
- Payment { payment_hash : PaymentHash , payment_preimage : Option < PaymentPreimage > } ,
814
- }
815
-
816
- impl Writeable for HTLCDestination {
817
- fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
818
- match self {
819
- HTLCDestination :: OpenChannel { ref node_id, ref channel_id } => {
820
- 0u8 . write ( writer) ?;
821
- node_id. write ( writer) ?;
822
- channel_id. write ( writer) ?;
823
- } ,
824
- HTLCDestination :: Unknown { ref previous_hop_scid } => {
825
- 1u8 . write ( writer) ?;
826
- previous_hop_scid. write ( writer) ?;
827
- } ,
828
- HTLCDestination :: Payment { ref payment_hash, ref payment_preimage } => {
829
- 2u8 . write ( writer) ?;
830
- payment_hash. write ( writer) ?;
831
- payment_preimage. write ( writer) ?;
832
- }
833
- }
834
- Ok ( ( ) )
835
- }
836
- }
837
-
838
807
macro_rules! secp_check {
839
808
( $res: expr, $err: expr) => {
840
809
match $res {
0 commit comments