You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+18-34Lines changed: 18 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ use ln::{PaymentPreimage, PaymentHash};
26
26
use ln::features::{ChannelFeatures,InitFeatures};
27
27
use ln::msgs;
28
28
use ln::msgs::{DecodeError,OptionalField,DataLossProtect};
29
+
use ln::script::ShutdownScript;
29
30
use ln::channelmanager::{PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
30
31
use ln::chan_utils::{CounterpartyCommitmentSecrets,TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript,ChannelPublicKeys,CommitmentTransaction,HolderCommitmentTransaction,ChannelTransactionParameters,CounterpartyChannelTransactionParameters,MAX_HTLCS, get_commitment_transaction_number_obscure_factor};
31
32
use ln::chan_utils;
@@ -44,10 +45,10 @@ use util::scid_utils::scid_from_parts;
44
45
use prelude::*;
45
46
use core::{cmp,mem,fmt};
46
47
use core::ops::Deref;
48
+
use std::convert::TryFrom;
47
49
#[cfg(any(test, feature = "fuzztarget"))]
48
50
use std::sync::Mutex;
49
51
use bitcoin::hashes::hex::ToHex;
50
-
use bitcoin::blockdata::opcodes::all::OP_PUSHBYTES_0;
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
Err(_) => returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
791
+
}
791
792
}
792
793
},
793
794
// Peer is signaling upfront shutdown but don't opt-out with correct mechanism (a.k.a 0-length script). Peer looks buggy, we fail the channel
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
Err(_) => returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
1502
+
}
1502
1503
}
1503
1504
},
1504
1505
// Peer is signaling upfront shutdown but don't opt-out with correct mechanism (a.k.a 0-length script). Peer looks buggy, we fail the channel
returnErr(ChannelError::Close(format!("Got shutdown request with a scriptpubkey ({}) which did not match their previous scriptpubkey.",msg.scriptpubkey.to_bytes().to_hex())));
returnErr(ChannelError::Close(format!("Got shutdown request with a scriptpubkey ({}) which did not match their previous scriptpubkey.",shutdown_scriptpubkey.to_bytes().to_hex())));
0 commit comments