lnd/lntemp/utils.go
yyforyongyu 00b143eac8
lntemp: add utils and fee service
This commit adds several helper functions and a fee service. Note that
the fee service is identical to what's inside `lntest`. Once the
migration is done, the old file will be removed.
2022-10-14 15:45:23 +08:00

37 lines
560 B
Go

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()
}