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
Update commitment_signed message to contain the funding_txid instead of
both that and a batch_size. The spec was updated to batch messages using
start_batch, which contains the batch_size. This commit also updates
PeerManager to batch commitment_signed messages in this manner instead
of the previous custom approach.
log_debug!(logger,"Peer {} sent batched commitment_signed for the wrong channel (expected: {}, actual: {})", log_pubkey!(their_node_id), channel_id,&msg.channel_id);
1781
1800
returnErr(PeerHandleError{}.into());
1782
1801
}
1783
1802
1784
-
constCOMMITMENT_SIGNED_BATCH_LIMIT:usize = 100;
1785
-
if buffer.len() == COMMITMENT_SIGNED_BATCH_LIMIT{
1786
-
log_debug!(logger,"Peer {} sent batched commitment_signed for channel {} exceeding the limit", log_pubkey!(their_node_id), channel_id);
1787
-
returnErr(PeerHandleError{}.into());
1788
-
}
1803
+
let funding_txid = match msg.funding_txid{
1804
+
Some(funding_txid) => funding_txid,
1805
+
None => {
1806
+
log_debug!(logger,"Peer {} sent batched commitment_signed without a funding_txid for channel {}", log_pubkey!(their_node_id), channel_id);
log_debug!(logger,"Peer {} sent batched commitment_signed with duplicate funding_txid {} for channel {}", log_pubkey!(their_node_id),channel_id,&batch.funding_txid);
1814
+
log_debug!(logger,"Peer {} sent batched commitment_signed with duplicate funding_txid {} for channel {}", log_pubkey!(their_node_id),funding_txid, channel_id);
1795
1815
returnErr(PeerHandleError{}.into());
1796
1816
}
1797
1817
}
1798
1818
1799
-
if buffer.len()>= batch_size {
1800
-
let(channel_id, batch) = peer_lock.commitment_signed_batch.take().expect("batch should have been inserted");
1819
+
if buffer.len()== *batch_size {
1820
+
let(channel_id,_,batch) = peer_lock.commitment_signed_batch.take().expect("batch should have been inserted");
log_debug!(logger,"Peer {} sent non-batched commitment_signed for channel {} when expecting batched commitment_signed", log_pubkey!(their_node_id),&msg.channel_id);
0 commit comments