mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-01-03 17:39:48 +00:00
Change estimate fee for stagenet to 56000
TODO: Create in-memory cache for NetFees function.
This commit is contained in:
parent
e83045f8b5
commit
55f6af1f22
4 changed files with 9 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load({ data }) {
|
||||
export async function load() {
|
||||
return {
|
||||
// prettier-ignore
|
||||
meta: {
|
||||
|
@ -20,7 +20,7 @@ export async function load({ data }) {
|
|||
},
|
||||
{
|
||||
nettype: 'stagenet',
|
||||
estimate_fee: 57000
|
||||
estimate_fee: 56000
|
||||
},
|
||||
{
|
||||
nettype: 'testnet',
|
||||
|
|
|
@ -131,12 +131,12 @@ func AddNode(c *fiber.Ctx) error {
|
|||
})
|
||||
}
|
||||
|
||||
func NetFee(c *fiber.Ctx) error {
|
||||
func NetFees(c *fiber.Ctx) error {
|
||||
moneroRepo := monero.New()
|
||||
return c.JSON(fiber.Map{
|
||||
"status": "ok",
|
||||
"message": "Success",
|
||||
"data": moneroRepo.NetFee(),
|
||||
"data": moneroRepo.NetFees(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ func V1Api(app *fiber.App) {
|
|||
v1.Post("/nodes", AddNode)
|
||||
v1.Get("/nodes/id/:id", MoneroNode)
|
||||
v1.Get("/nodes/logs", ProbeLogs)
|
||||
v1.Get("/fees", NetFee)
|
||||
v1.Get("/fees", NetFees)
|
||||
v1.Get("/countries", Countries)
|
||||
v1.Get("/job", CheckProber, GiveJob)
|
||||
v1.Post("/job", CheckProber, ProcessJob)
|
||||
|
|
|
@ -19,7 +19,7 @@ type MoneroRepository interface {
|
|||
Node(id int) (Node, error)
|
||||
Add(protocol string, host string, port uint) error
|
||||
Nodes(QueryNodes) (Nodes, error)
|
||||
NetFee() []NetFee
|
||||
NetFees() []NetFee
|
||||
Countries() ([]Countries, error)
|
||||
GiveJob(acceptTor int) (Node, error)
|
||||
ProcessJob(report ProbeReport, proberId int64) error
|
||||
|
@ -310,7 +310,9 @@ type NetFee struct {
|
|||
NodeCount int `json:"node_count" db:"node_count"`
|
||||
}
|
||||
|
||||
func (r *MoneroRepo) NetFee() []NetFee {
|
||||
// Get majority net fee from database
|
||||
func (r *MoneroRepo) NetFees() []NetFee {
|
||||
// TODO: Create in-memory cache for this
|
||||
netTypes := [3]string{"mainnet", "stagenet", "testnet"}
|
||||
netFees := []NetFee{}
|
||||
|
||||
|
|
Loading…
Reference in a new issue