lnwallet: replace empty byte arrays with nils

This commit is contained in:
Alex 2017-05-18 12:58:19 -06:00 committed by Olaoluwa Osuntokun
parent 25dc294cf0
commit 5746e764cb

@ -298,7 +298,7 @@ func senderHtlcSpendRedeem(commitScript []byte, outputAmt btcutil.Amount,
witnessStack := wire.TxWitness(make([][]byte, 5))
witnessStack[0] = sweepSig
witnessStack[1] = paymentPreimage
witnessStack[2] = []byte{}
witnessStack[2] = nil
witnessStack[3] = []byte{1}
witnessStack[4] = commitScript
@ -340,7 +340,7 @@ func senderHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
// order to force Script execution to the HTLC timeout clause.
witnessStack := wire.TxWitness(make([][]byte, 3))
witnessStack[0] = sweepSig
witnessStack[1] = []byte{}
witnessStack[1] = nil
witnessStack[2] = commitScript
return witnessStack, nil
@ -504,7 +504,7 @@ func receiverHtlcSpendRevoke(commitScript []byte, outputAmt btcutil.Amount,
witnessStack[0] = sweepSig
witnessStack[1] = revokePreimage
witnessStack[2] = []byte{1}
witnessStack[3] = []byte{}
witnessStack[3] = nil
witnessStack[4] = commitScript
return witnessStack, nil
@ -533,8 +533,8 @@ func receiverHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
witnessStack := wire.TxWitness(make([][]byte, 4))
witnessStack[0] = sweepSig
witnessStack[1] = []byte{}
witnessStack[2] = []byte{}
witnessStack[1] = nil
witnessStack[2] = nil
witnessStack[3] = commitScript
return witnessStack, nil