@@ -827,9 +827,15 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
827
827
case Event (msg : SpliceInit , d : DATA_NORMAL ) =>
828
828
d.spliceStatus match {
829
829
case SpliceStatus .NoSplice =>
830
- if (d.commitments.isIdle) {
830
+ if (! d.commitments.isIdle) {
831
+ log.info(" rejecting splice request: channel not idle" )
832
+ stay() using d.copy(spliceStatus = SpliceStatus .SpliceAborted ) sending TxAbort (d.channelId, InvalidSpliceRequest (d.channelId).getMessage)
833
+ } else if (msg.feerate < nodeParams.onChainFeeConf.feeEstimator.getMempoolMinFeeratePerKw()) {
834
+ log.info(" rejecting splice request: feerate too low" )
835
+ stay() using d.copy(spliceStatus = SpliceStatus .SpliceAborted ) sending TxAbort (d.channelId, InvalidSpliceRequest (d.channelId).getMessage)
836
+ } else {
831
837
log.info(s " accepting splice with remote.in.amount= ${msg.fundingContribution} remote.in.push= ${msg.pushAmount}" )
832
- val parentCommitment = d.commitments.latest.commitment
838
+ val parentCommitment = d.commitments.latest.commitment
833
839
val spliceAck = SpliceAck (d.channelId,
834
840
fundingContribution = 0 .sat, // only remote contributes to the splice
835
841
fundingPubKey = keyManager.fundingPublicKey(d.commitments.params.localParams.fundingKeyPath, parentCommitment.fundingTxIndex + 1 ).publicKey,
@@ -858,9 +864,6 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
858
864
))
859
865
txBuilder ! InteractiveTxBuilder .Start (self)
860
866
stay() using d.copy(spliceStatus = SpliceStatus .SpliceInProgress (cmd_opt = None , splice = txBuilder, remoteCommitSig = None )) sending spliceAck
861
- } else {
862
- log.info(" rejecting splice request, channel not idle or not compatible" )
863
- stay() using d.copy(spliceStatus = SpliceStatus .SpliceAborted ) sending TxAbort (d.channelId, InvalidSpliceRequest (d.channelId).getMessage)
864
867
}
865
868
case SpliceStatus .SpliceAborted =>
866
869
log.info(" rejecting splice attempt: our previous tx_abort was not acked" )
0 commit comments