multi: use btcd's btcec/v2 and btcutil modules

This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
This commit is contained in:
Oliver Gugger committed 2022-03-09 19:02:37 +01:00
1 parent 8ee9fc837b
commit 7dfe4018ce
350 files changed
+2421 -1289

No files matched your search

+10 -9
View File
@@ -8,11 +8,12 @@ import (
"sync"
"time"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/ecdsa"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/chainntnfs"
@@ -327,7 +328,7 @@ type Config struct {
// TODO(roasbeef): should instead pass on this responsibility to a
// distinct sub-system?
SignMessage func(keyLoc keychain.KeyLocator,
msg []byte, doubleHash bool) (*btcec.Signature, error)
msg []byte, doubleHash bool) (*ecdsa.Signature, error)
// CurrentNodeAnnouncement should return the latest, fully signed node
// announcement from the backing Lightning Network node.
@@ -3512,7 +3513,8 @@ func (f *Manager) pruneZombieReservations() {
for pendingChanID, resCtx := range zombieReservations {
err := fmt.Errorf("reservation timed out waiting for peer "+
"(peer_id:%x, chan_id:%x)", resCtx.peer.IdentityKey(),
"(peer_id:%x, chan_id:%x)",
resCtx.peer.IdentityKey().SerializeCompressed(),
pendingChanID[:])
log.Warnf(err.Error())
f.failFundingFlow(resCtx.peer, pendingChanID, err)
@@ -3627,11 +3629,10 @@ func (f *Manager) IsPendingChannel(pendingChanID [32]byte,
}
func copyPubKey(pub *btcec.PublicKey) *btcec.PublicKey {
return &btcec.PublicKey{
Curve: btcec.S256(),
X: pub.X,
Y: pub.Y,
}
var tmp btcec.JacobianPoint
pub.AsJacobian(&tmp)
tmp.ToAffine()
return btcec.NewPublicKey(&tmp.X, &tmp.Y)
}
// saveChannelOpeningState saves the channelOpeningState for the provided