Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_current_mtp API call #1338

Closed
cipig opened this issue Jul 12, 2022 · 6 comments · Fixed by #1340
Closed

add get_current_mtp API call #1338

cipig opened this issue Jul 12, 2022 · 6 comments · Fixed by #1340
Assignees

Comments

@cipig
Copy link
Member

cipig commented Jul 12, 2022

We stumbled upon some electrum servers that set a wrong MTP which then leads to problems like #1281 in mm2.

It would be very helpful to have a get_current_mtp API call in mm2, so we can check the electrums for this problem and avoid those that have it and as such don't add them to ADEX Desktop/Mobile config.

@artemii235
Copy link
Member

We stumbled upon some electrum servers that set a wrong MTP

@cipig Could you please provide more input on this? Basically, electrums do not set an MTP in any way, it's calculated in MM2 by requesting recent block headers and using their timestamps.

@shamardy
Copy link
Collaborator

@cipig This is ready for testing. @smk762 This is ready for documentation in the dev branch.

@borngraced could you please provide information about the new RPC method, please also add it to the postman collection and open a PR to developer-docs.

@borngraced
Copy link
Member

borngraced commented Jul 27, 2022

The get_current_mtp RPC is used for getting the Median Time Past (MTP) of supported coins(UTXO).

— very useful for debugging some common bugs in mm2

USAGE

example request:

{
	"method": "get_current_mtp",
	"userpass": "USERPASS",
	"mmrpc": "2.0",
	"params": {
		"coin": "KMD"
	}
}

example response

{
   "mmrpc": "2.0",
   "result": {
   	"mtp": 1658746383
   },
   "id": null
}

@artemii235
Copy link
Member

@cipig Did you have a chance to test it?

@smk762
Copy link

smk762 commented Sep 2, 2022

@cipig
Copy link
Member Author

cipig commented Sep 2, 2022

works fine, checked couple coins, compared to block explorer and the values look fine

@cipig cipig closed this as completed Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants