forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lightningnetwork#4857 from cfromknecht/meta-index-…
…reinit channeldb+tlv: add channel meta-index
- Loading branch information
Showing
7 changed files
with
470 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package migration20 | ||
|
||
import ( | ||
"encoding/binary" | ||
"io" | ||
|
||
"github.com/btcsuite/btcd/wire" | ||
) | ||
|
||
var ( | ||
byteOrder = binary.BigEndian | ||
) | ||
|
||
// writeOutpoint writes an outpoint from the passed writer. | ||
func writeOutpoint(w io.Writer, o *wire.OutPoint) error { | ||
if _, err := w.Write(o.Hash[:]); err != nil { | ||
return err | ||
} | ||
if err := binary.Write(w, byteOrder, o.Index); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// readOutpoint reads an outpoint from the passed reader. | ||
func readOutpoint(r io.Reader, o *wire.OutPoint) error { | ||
if _, err := io.ReadFull(r, o.Hash[:]); err != nil { | ||
return err | ||
} | ||
if err := binary.Read(r, byteOrder, &o.Index); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package migration20 | ||
|
||
import ( | ||
"github.com/btcsuite/btclog" | ||
) | ||
|
||
// log is a logger that is initialized as disabled. This means the package | ||
// will not perform any logging by default until a logger is set. | ||
var log = btclog.Disabled | ||
|
||
// UseLogger uses a specified Logger to output package logging info. | ||
func UseLogger(logger btclog.Logger) { | ||
log = logger | ||
} |
Oops, something went wrong.