multi: remove dead code
This commit is contained in:
71 files changed
+35
-766
No files matched your search
@@ -2298,23 +2298,6 @@ func serializeChannelCloseSummary(w io.Writer, cs *ChannelCloseSummary) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func fetchChannelCloseSummary(tx *bbolt.Tx,
|
||||
chanID []byte) (*ChannelCloseSummary, error) {
|
||||
|
||||
closedChanBucket, err := tx.CreateBucketIfNotExists(closedChannelBucket)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
summaryBytes := closedChanBucket.Get(chanID)
|
||||
if summaryBytes == nil {
|
||||
return nil, fmt.Errorf("closed channel summary not found")
|
||||
}
|
||||
|
||||
summaryReader := bytes.NewReader(summaryBytes)
|
||||
return deserializeCloseChannelSummary(summaryReader)
|
||||
}
|
||||
|
||||
func deserializeCloseChannelSummary(r io.Reader) (*ChannelCloseSummary, error) {
|
||||
c := &ChannelCloseSummary{}
|
||||
|
||||
@@ -2679,13 +2662,6 @@ func makeLogKey(updateNum uint64) [8]byte {
|
||||
return key
|
||||
}
|
||||
|
||||
// readLogKey parse the first 8- bytes of a byte slice into a uint64.
|
||||
//
|
||||
// NOTE: The slice must be at least 8 bytes long.
|
||||
func readLogKey(b []byte) uint64 {
|
||||
return byteOrder.Uint64(b)
|
||||
}
|
||||
|
||||
func appendChannelLogEntry(log *bbolt.Bucket,
|
||||
commit *ChannelCommitment) error {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
@@ -23,23 +22,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
netParams = &chaincfg.TestNet3Params
|
||||
|
||||
key = [chainhash.HashSize]byte{
|
||||
0x81, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda,
|
||||
0x68, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17,
|
||||
0xd, 0xe7, 0x93, 0xe4, 0xb7, 0x25, 0xb8, 0x4d,
|
||||
0x1e, 0xb, 0x4c, 0xf9, 0x9e, 0xc5, 0x8c, 0xe9,
|
||||
}
|
||||
id = &wire.OutPoint{
|
||||
Hash: [chainhash.HashSize]byte{
|
||||
0x51, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda,
|
||||
0x48, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17,
|
||||
0x2d, 0xe7, 0x93, 0xe4, 0xb7, 0x25, 0xb8, 0x4d,
|
||||
0x1f, 0xb, 0x4c, 0xf9, 0x9e, 0xc5, 0x8c, 0xe9,
|
||||
},
|
||||
Index: 9,
|
||||
}
|
||||
rev = [chainhash.HashSize]byte{
|
||||
0x51, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda,
|
||||
0x48, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17,
|
||||
@@ -77,10 +65,6 @@ var (
|
||||
},
|
||||
LockTime: 5,
|
||||
}
|
||||
testOutpoint = &wire.OutPoint{
|
||||
Hash: key,
|
||||
Index: 0,
|
||||
}
|
||||
privKey, pubKey = btcec.PrivKeyFromBytes(btcec.S256(), key[:])
|
||||
|
||||
wireSig, _ = lnwire.NewSigFromSignature(testSig)
|
||||
|
||||
@@ -15,9 +15,6 @@ import (
|
||||
"github.com/lightningnetwork/lnd/shachain"
|
||||
)
|
||||
|
||||
// outPointSize is the size of a serialized outpoint on disk.
|
||||
const outPointSize = 36
|
||||
|
||||
// writeOutpoint writes an outpoint to the passed writer using the minimal
|
||||
// amount of bytes possible.
|
||||
func writeOutpoint(w io.Writer, o *wire.OutPoint) error {
|
||||
|
||||
@@ -919,11 +919,6 @@ func uint16Key(i uint16) []byte {
|
||||
return key
|
||||
}
|
||||
|
||||
// uint16FromKey reconstructs a 16-bit unsigned integer from a 2-byte slice.
|
||||
func uint16FromKey(key []byte) uint16 {
|
||||
return byteOrder.Uint16(key)
|
||||
}
|
||||
|
||||
// Compile-time constraint to ensure that ChannelPackager implements the public
|
||||
// FwdPackager interface.
|
||||
var _ FwdPackager = (*ChannelPackager)(nil)
|
||||
|
||||
@@ -29,9 +29,7 @@ var (
|
||||
"[2001:db8:85a3:0:0:8a2e:370:7334]:80")
|
||||
testAddrs = []net.Addr{testAddr, anotherAddr}
|
||||
|
||||
randSource = prand.NewSource(time.Now().Unix())
|
||||
randInts = prand.New(randSource)
|
||||
testSig = &btcec.Signature{
|
||||
testSig = &btcec.Signature{
|
||||
R: new(big.Int),
|
||||
S: new(big.Int),
|
||||
}
|
||||
|
||||
@@ -101,14 +101,6 @@ func makeFakeInfo() (*PaymentCreationInfo, *PaymentAttemptInfo) {
|
||||
return c, a
|
||||
}
|
||||
|
||||
func makeFakePaymentHash() [32]byte {
|
||||
var paymentHash [32]byte
|
||||
rBytes, _ := randomBytes(0, 32)
|
||||
copy(paymentHash[:], rBytes)
|
||||
|
||||
return paymentHash
|
||||
}
|
||||
|
||||
// randomBytes creates random []byte with length in range [minLen, maxLen)
|
||||
func randomBytes(minLen, maxLen int) ([]byte, error) {
|
||||
randBuf := make([]byte, minLen+rand.Intn(maxLen-minLen))
|
||||
|
||||
Reference in new issue
Block a user