mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
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.
37 lines
560 B
Go
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()
|
|
}
|