linter: fix new warnings

This commit is contained in:
Andrey Samokhvalov 2017-03-16 14:04:19 +03:00 committed by Olaoluwa Osuntokun
parent a423dc3e6c
commit 9dfaca1632
3 changed files with 3 additions and 5 deletions

View File

@ -58,9 +58,7 @@ func TestChannelAnnoucementValidation(t *testing.T) {
firstBitcoinPrivKey, firstBitcoinPubKey := getKeys("bitcoin-key-1")
secondBitcoinPrivKey, secondBitcoinPubKey := getKeys("bitcoin-key-2")
var hash []byte
hash = chainhash.DoubleHashB(firstNodePubKey.SerializeCompressed())
hash := chainhash.DoubleHashB(firstNodePubKey.SerializeCompressed())
firstBitcoinSig, _ := firstBitcoinPrivKey.Sign(hash)
hash = chainhash.DoubleHashB(secondNodePubKey.SerializeCompressed())

View File

@ -65,7 +65,7 @@ func deserializeSigFromWire(e **btcec.Signature, b [64]byte) error {
// Create a canonical serialized signature. DER format is:
// 0x30 <length> 0x02 <length r> r 0x02 <length s> s
sigBytes := make([]byte, 6+rLen+sLen, 6+rLen+sLen)
sigBytes := make([]byte, 6+rLen+sLen)
sigBytes[0] = 0x30 // DER signature magic value
sigBytes[1] = 4 + rLen + sLen // Length of rest of signature
sigBytes[2] = 0x02 // Big integer magic value

View File

@ -462,7 +462,7 @@ func (l *lightningNode) lightningNetworkWatcher() {
// If this is a open request, then it can be
// dispatched if the number of edges seen for
// the channel is at least two.
if numEdges, _ := openChans[targetChan]; numEdges >= 2 {
if numEdges := openChans[targetChan]; numEdges >= 2 {
close(watchRequest.eventChan)
continue
}