lnd/lntemp/utils.go

38 lines
560 B
Go
Raw Normal View History

package lntemp
import (
"io"
"os"
"github.com/lightningnetwork/lnd/lntest"
)
const (
// NeutrinoBackendName is the name of the neutrino backend.
NeutrinoBackendName = "neutrino"
// TODO(yy): delete.
DefaultTimeout = lntest.DefaultTimeout
)
// CopyFile copies the file src to dest.
func CopyFile(dest, src string) error {
s, err := os.Open(src)
if err != nil {
return err
}
defer s.Close()
d, err := os.Create(dest)
if err != nil {
return err
}
if _, err := io.Copy(d, s); err != nil {
d.Close()
return err
}
return d.Close()
}