@@ -51,7 +51,11 @@ use util::ser::{Readable, ReadableArgs, MaybeReadable, Writer, Writeable, U48};
5151use util:: byte_utils;
5252use util:: events:: Event ;
5353
54- use crate :: { HashMap , HashSet , cmp, hash_map, mem, ops:: Deref } ;
54+ #[ cfg( feature = "no_std" ) ]
55+ #[ macro_use]
56+ use alloc:: { boxed:: Box , vec, vec:: Vec } ;
57+ use crate :: { HashMap , HashSet , hash_map} ;
58+ use core:: { cmp, mem, ops:: Deref } ;
5559use std:: io:: Error ;
5660use std:: sync:: Mutex ;
5761
@@ -85,7 +89,7 @@ pub struct ChannelMonitorUpdate {
8589/// then we allow the `ChannelManager` to send a `ChannelMonitorUpdate` with this update ID,
8690/// with the update providing said payment preimage. No other update types are allowed after
8791/// force-close.
88- pub const CLOSED_CHANNEL_UPDATE_ID : u64 = crate :: u64:: MAX ;
92+ pub const CLOSED_CHANNEL_UPDATE_ID : u64 = :: core :: u64:: MAX ;
8993
9094impl Writeable for ChannelMonitorUpdate {
9195 fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , :: std:: io:: Error > {
@@ -101,7 +105,7 @@ impl Readable for ChannelMonitorUpdate {
101105 fn read < R : :: std:: io:: Read > ( r : & mut R ) -> Result < Self , DecodeError > {
102106 let update_id: u64 = Readable :: read ( r) ?;
103107 let len: u64 = Readable :: read ( r) ?;
104- let mut updates = Vec :: with_capacity ( cmp:: min ( len as usize , MAX_ALLOC_SIZE / :: std :: mem:: size_of :: < ChannelMonitorUpdateStep > ( ) ) ) ;
108+ let mut updates = Vec :: with_capacity ( cmp:: min ( len as usize , MAX_ALLOC_SIZE / :: core :: mem:: size_of :: < ChannelMonitorUpdateStep > ( ) ) ) ;
105109 for _ in 0 ..len {
106110 updates. push ( Readable :: read ( r) ?) ;
107111 }
@@ -1819,7 +1823,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
18191823
18201824 for & ( ref htlc, _, _) in holder_tx. htlc_outputs . iter ( ) {
18211825 if let Some ( transaction_output_index) = htlc. transaction_output_index {
1822- claim_requests. push ( ClaimRequest { absolute_timelock : crate :: u32:: MAX , aggregable : false , outpoint : BitcoinOutPoint { txid : holder_tx. txid , vout : transaction_output_index as u32 } ,
1826+ claim_requests. push ( ClaimRequest { absolute_timelock : :: core :: u32:: MAX , aggregable : false , outpoint : BitcoinOutPoint { txid : holder_tx. txid , vout : transaction_output_index as u32 } ,
18231827 witness_data : InputMaterial :: HolderHTLC {
18241828 preimage : if !htlc. offered {
18251829 if let Some ( preimage) = self . payment_preimages . get ( & htlc. payment_hash ) {
@@ -2367,7 +2371,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
23672371 fn is_paying_spendable_output < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) where L :: Target : Logger {
23682372 let mut spendable_output = None ;
23692373 for ( i, outp) in tx. output . iter ( ) . enumerate ( ) { // There is max one spendable output for any channel tx, including ones generated by us
2370- if i > crate :: u16:: MAX as usize {
2374+ if i > :: core :: u16:: MAX as usize {
23712375 // While it is possible that an output exists on chain which is greater than the
23722376 // 2^16th output in a given transaction, this is only possible if the output is not
23732377 // in a lightning transaction and was instead placed there by some third party who
0 commit comments