asdf
This commit is contained in:
parent
76f56c163a
commit
9a0a44e688
2 changed files with 17 additions and 40 deletions
16
db/db.go
16
db/db.go
|
@ -173,6 +173,7 @@ func UnpackGenericValue(key, value []byte) (byte, interface{}, error) {
|
||||||
func NewIterateOptions() *IterOptions {
|
func NewIterateOptions() *IterOptions {
|
||||||
return &IterOptions{
|
return &IterOptions{
|
||||||
FillCache: false,
|
FillCache: false,
|
||||||
|
Prefix: []byte{},
|
||||||
Start: nil,
|
Start: nil,
|
||||||
Stop: nil,
|
Stop: nil,
|
||||||
IncludeStart: true,
|
IncludeStart: true,
|
||||||
|
@ -189,6 +190,11 @@ func (o *IterOptions) WithFillCache(fillCache bool) *IterOptions {
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *IterOptions) WithPrefix(prefix []byte) *IterOptions {
|
||||||
|
o.Prefix = prefix
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
func (o *IterOptions) WithStart(start []byte) *IterOptions {
|
func (o *IterOptions) WithStart(start []byte) *IterOptions {
|
||||||
o.Start = start
|
o.Start = start
|
||||||
return o
|
return o
|
||||||
|
@ -219,6 +225,16 @@ func (o *IterOptions) WithIncludeValue(includeValue bool) *IterOptions {
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *IterOptions) WithRawKey(rawKey bool) *IterOptions {
|
||||||
|
o.RawKey = rawKey
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IterOptions) WithRawValue(rawValue bool) *IterOptions {
|
||||||
|
o.RawValue = rawValue
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
func (k *UTXOKey) String() string {
|
func (k *UTXOKey) String() string {
|
||||||
return fmt.Sprintf(
|
return fmt.Sprintf(
|
||||||
"%s(hashX=%s, tx_num=%d, nout=%d)",
|
"%s(hashX=%s, tx_num=%d, nout=%d)",
|
||||||
|
|
|
@ -1,45 +1,6 @@
|
||||||
package prefixes
|
package prefixes
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
||||||
//ClaimToSupport = []byte("K")
|
|
||||||
//SupportToClaim = []byte("L")
|
|
||||||
//
|
|
||||||
//ClaimToTXO = []byte("E")
|
|
||||||
//TXOToClaim = []byte("G")
|
|
||||||
//
|
|
||||||
//ClaimToChannel = []byte("I")
|
|
||||||
//ChannelToClaim = []byte("J")
|
|
||||||
//
|
|
||||||
//ClaimShortIdPrefix = []byte("F")
|
|
||||||
//EffectiveAmount = []byte("D")
|
|
||||||
//ClaimExpiration = []byte("O")
|
|
||||||
//
|
|
||||||
//ClaimTakeover = []byte("P")
|
|
||||||
//PendingActivation = []byte("Q")
|
|
||||||
//ActivatedClaimAndSupport = []byte("R")
|
|
||||||
//ActiveAmount = []byte("S")
|
|
||||||
//
|
|
||||||
//Repost = []byte("V")
|
|
||||||
//RepostedClaim = []byte("W")
|
|
||||||
//
|
|
||||||
//Undo = []byte("M")
|
|
||||||
//ClaimDiff = []byte("Y")
|
|
||||||
//
|
|
||||||
//Tx = []byte("B")
|
|
||||||
//BlockHash = []byte("C")
|
|
||||||
//Header = []byte("H")
|
|
||||||
//TxNum = []byte("N")
|
|
||||||
//TxCount = []byte("T")
|
|
||||||
//TxHash = []byte("X")
|
|
||||||
//UTXO = []byte("u")
|
|
||||||
//HashXUTXO = []byte("h")
|
|
||||||
//HashXHistory = []byte("x")
|
|
||||||
//DBState = []byte("s")
|
|
||||||
//ChannelCount = []byte("Z")
|
|
||||||
//SupportAmount = []byte("a")
|
|
||||||
//BlockTXs = []byte("b")
|
|
||||||
|
|
||||||
ClaimToSupport = 'K'
|
ClaimToSupport = 'K'
|
||||||
SupportToClaim = 'L'
|
SupportToClaim = 'L'
|
||||||
|
|
||||||
|
@ -53,10 +14,10 @@ const (
|
||||||
EffectiveAmount = 'D'
|
EffectiveAmount = 'D'
|
||||||
ClaimExpiration = 'O'
|
ClaimExpiration = 'O'
|
||||||
|
|
||||||
|
ActiveAmount = 'S'
|
||||||
ClaimTakeover = 'P'
|
ClaimTakeover = 'P'
|
||||||
PendingActivation = 'Q'
|
PendingActivation = 'Q'
|
||||||
ActivatedClaimAndSupport = 'R'
|
ActivatedClaimAndSupport = 'R'
|
||||||
ActiveAmount = 'S'
|
|
||||||
|
|
||||||
Repost = 'V'
|
Repost = 'V'
|
||||||
RepostedClaim = 'W'
|
RepostedClaim = 'W'
|
||||||
|
|
Loading…
Add table
Reference in a new issue