mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/enode: remove ticket database accessors
This commit is contained in:
parent
cdea5108db
commit
b2e95a239b
1 changed files with 1 additions and 18 deletions
|
|
@ -51,13 +51,9 @@ const (
|
||||||
dbNodeSeq = "seq"
|
dbNodeSeq = "seq"
|
||||||
dbNodeKeys = "keys"
|
dbNodeKeys = "keys"
|
||||||
|
|
||||||
// V5 information is stored by ID, the full key is "n:<ID>:v5:issuedt"
|
|
||||||
dbNodeIssuedTickets = "issuedt"
|
|
||||||
dbNodeUsedTickets = "usedt"
|
|
||||||
dbLocalSeq = "seq"
|
|
||||||
|
|
||||||
// Local information is keyed by ID only, the full key is "local:<ID>:seq".
|
// Local information is keyed by ID only, the full key is "local:<ID>:seq".
|
||||||
// Use localItemKey to create those keys.
|
// Use localItemKey to create those keys.
|
||||||
|
dbLocalSeq = "seq"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -393,19 +389,6 @@ func (db *DB) UpdateFindFails(id ID, ip net.IP, fails int) error {
|
||||||
return db.storeInt64(nodeItemKey(id, ip, dbNodeFindFails), int64(fails))
|
return db.storeInt64(nodeItemKey(id, ip, dbNodeFindFails), int64(fails))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TopicRegTicketsV5 returns the ticket-related counters of a node.
|
|
||||||
func (db *DB) TopicRegTicketsV5(id ID) (uint32, uint32) {
|
|
||||||
issued := db.fetchUint64(v5Key(id, dbNodeIssuedTickets))
|
|
||||||
used := db.fetchUint64(v5Key(id, dbNodeUsedTickets))
|
|
||||||
return uint32(issued), uint32(used)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateTopicRegTicketsV5 updates the ticket-related counters of a node.
|
|
||||||
func (db *DB) UpdateTopicRegTicketsV5(id ID, issued, used uint32) {
|
|
||||||
db.storeUint64(v5Key(id, dbNodeIssuedTickets), uint64(issued))
|
|
||||||
db.storeUint64(v5Key(id, dbNodeUsedTickets), uint64(used))
|
|
||||||
}
|
|
||||||
|
|
||||||
// FindFailsV5 retrieves the discv5 findnode failure counter.
|
// FindFailsV5 retrieves the discv5 findnode failure counter.
|
||||||
func (db *DB) FindFailsV5(id ID) int {
|
func (db *DB) FindFailsV5(id ID) int {
|
||||||
return int(db.fetchInt64(v5Key(id, dbNodeFindFails)))
|
return int(db.fetchInt64(v5Key(id, dbNodeFindFails)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue