projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP
[rust-lightning]
/
lightning
/
src
/
ln
/
onchaintx.rs
diff --git
a/lightning/src/ln/onchaintx.rs
b/lightning/src/ln/onchaintx.rs
index f263ddf434b5d83f4c78be7b6bf72fca7fd56d8e..f4926471d1de4441338e3f64aab761959f5d452c 100644
(file)
--- a/
lightning/src/ln/onchaintx.rs
+++ b/
lightning/src/ln/onchaintx.rs
@@
-376,19
+376,19
@@
impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
tx_weight += match inp {
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::RevokedOfferedHTLC => {
tx_weight += match inp {
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::RevokedOfferedHTLC => {
- 1 + 1 + 73 + 1 + 33 + 1 + 13
3
+ 1 + 1 + 73 + 1 + 33 + 1 + 13
6
},
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::RevokedReceivedHTLC => {
},
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::RevokedReceivedHTLC => {
- 1 + 1 + 73 + 1 + 33 + 1 + 1
39
+ 1 + 1 + 73 + 1 + 33 + 1 + 1
42
},
// number_of_witness_elements + sig_length + remotehtlc_sig + preimage_length + preimage + witness_script_length + witness_script
&InputDescriptors::OfferedHTLC => {
},
// number_of_witness_elements + sig_length + remotehtlc_sig + preimage_length + preimage + witness_script_length + witness_script
&InputDescriptors::OfferedHTLC => {
- 1 + 1 + 73 + 1 + 32 + 1 + 13
3
+ 1 + 1 + 73 + 1 + 32 + 1 + 13
6
},
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::ReceivedHTLC => {
},
// number_of_witness_elements + sig_length + revocation_sig + pubkey_length + revocationpubkey + witness_script_length + witness_script
&InputDescriptors::ReceivedHTLC => {
- 1 + 1 + 73 + 1 + 1 + 1 + 1
39
+ 1 + 1 + 73 + 1 + 1 + 1 + 1
42
},
// number_of_witness_elements + sig_length + revocation_sig + true_length + op_true + witness_script_length + witness_script
&InputDescriptors::RevokedOutput => {
},
// number_of_witness_elements + sig_length + revocation_sig + true_length + op_true + witness_script_length + witness_script
&InputDescriptors::RevokedOutput => {
@@
-421,12
+421,16
@@
impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
{
if cached_claim_datas.per_input_material.len() == 0 { return None } // But don't prune pending claiming request yet, we may have to resurrect HTLCs
let mut inputs = Vec::new();
{
if cached_claim_datas.per_input_material.len() == 0 { return None } // But don't prune pending claiming request yet, we may have to resurrect HTLCs
let mut inputs = Vec::new();
- for
outp in cached_claim_datas.per_input_material.keys
() {
+ for
(outp, material) in cached_claim_datas.per_input_material.iter
() {
log_trace!(logger, "Outpoint {}:{}", outp.txid, outp.vout);
inputs.push(TxIn {
previous_output: *outp,
script_sig: Script::new(),
log_trace!(logger, "Outpoint {}:{}", outp.txid, outp.vout);
inputs.push(TxIn {
previous_output: *outp,
script_sig: Script::new(),
- sequence: 0xfffffffd,
+ sequence: match material {
+ &InputMaterial::Revoked { .. } => 1, // XXX: Depends on spec discussion
+ &InputMaterial::RemoteHTLC { .. } => 1,
+ &InputMaterial::LocalHTLC { .. } => 1,
+ },
witness: Vec::new(),
});
}
witness: Vec::new(),
});
}