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

Block not found error on Maker payment wait refund #828

Closed
cipig opened this issue Feb 21, 2021 · 6 comments
Closed

Block not found error on Maker payment wait refund #828

cipig opened this issue Feb 21, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@cipig
Copy link
Member

cipig commented Feb 21, 2021

mm2src/lp_swap/maker_swap.rs:779] ERROR Error rpc_clients:577] JsonRpcError { client_info: "coin: FIRO", request: JsonRpcRequest { jsonrpc: "1.0", id: "8455", method: "getblock", params: [String("347565"), Bool(true)] }, error: Transport("rpc_clients:445] Rpc request JsonRpcRequest { jsonrpc: \"1.0\", id: \"8455\", method: \"getblock\", params: [String(\"347565\"), Bool(true)] } failed with HTTP status code 500 Internal Server Error, response body: {\"result\":null,\"error\":{\"code\":-5,\"message\":\"Block not found\"},\"id\":\"8455\"}\n") } on can_refund_htlc, retrying in 30 seconds

while [swap uuid=5bb29ece-cba3-4e2a-b059-91bb5fcbb450] Maker payment wait refund till 1613769580 started...

the block 347565 mentioned in the error is already mined, error is likely because getblock accepts only a hash, not a height

firo-cli getblock 347565 true
error code: -5
error message:
Block not found
firo-cli help getblock
getblock "blockhash" ( verbose )

If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'.
If verbose is true, returns an Object with information about block <hash>.

Arguments:
1. "blockhash"          (string, required) The block hash
2. verbose                (boolean, optional, default=true) true for a json object, false for the hex encoded data
@artemii235 artemii235 self-assigned this Feb 22, 2021
@artemii235 artemii235 added the bug Something isn't working label Feb 22, 2021
@artemii235
Copy link
Member

@cipig Thanks for opening the issue! Could you test the https://github.com/KomodoPlatform/atomicDEX-API/tree/mm2.1-getblock-hash-only branch, please?

@cipig
Copy link
Member Author

cipig commented Feb 22, 2021

Gettings this now

22 14:07:35, mm2src/lp_swap/maker_swap.rs:779] ERROR Error rpc_clients:578] JsonRpcError { client_info: "coin: FIRO", request: JsonRpcRequest { jsonrpc: "1.0", id: "33", method: "getblock", params: [String("e21ea157b142270ba479a0aeb5571144b2a06f66a693c20675c624a6f211de0a"), Bool(true)] }, error: Parse(http://127.0.0.1:8888, "jsonrpc_client:183] error Error(\"invalid type: integer `43516489`, expected a string\", line: 0, column: 0) parsing result from response JsonRpcResponse { jsonrpc: \"\", id: \"33\", result: Object({\"hash\": String(\"e21ea157b142270ba479a0aeb5571144b2a06f66a693c20675c624a6f211de0a\"), \"confirmations\": Number(1), \"strippedsize\": Number(234913), \"size\": Number(234913), \"weight\": Number(234913), \"height\": Number(348355), \"version\": Number(536875008), \"versionHex\": String(\"20001000\"), \"merkleroot\": String(\"b7fa3ce26f5b493397302c260905ca6f8c9ade56cab7cb314dc6f8a1d4c69245\"), \"tx\": Array([String(\"166d2e6c6b8e1f29192737be5b0df79f7ccb286a898a3bf7253aa091e1002756\"), String(\"f0bcbf10f2aa20d6891c14fdf64eb336df2d4466ebbc6bd5349c61478be77bd3\"), String(\"0305f0fed2286b4504907bd2588dec5205f0807f11d003489b6748437728b6dc\"), String(\"17f69f35b125de65e140de9bffe873702a4550379fb0ae4fe371f703c739e268\"), String(\"ca60309ee4f846f607295aabcea2d0680ca23a7fbb8699ad1b597255ad6c5a73\"), String(\"5aec101f7b2452d293c1a1c3889861bc8e96081f3ecd328859bc005c14d2737e\"), String(\"bd9a8a2fdbad3db6c38e6472fd2e50d452a98553c8a105cb10afc85b5eaadee0\"), String(\"0a52a67bf6ca3784f81b828616cda6bdca314402cded278d98f94b546784a58d\"), String(\"55e6f918b2e7af2886499919b1c4a2ba341180934a4691a1a7166d6dadfcf8b9\"), String(\"7a2d8b10b3bfc3037ee884699ca4770d96575b2d39179801d760d1c86377ff58\"), String(\"ded160f1ec3e978daa2d8adb0b611223946db1c1155522cf9f0796e6f6c081fe\")]), \"cbTx\": Object({\"version\": Number(2), \"height\": Number(348355), \"merkleRootMNList\": String(\"5bd9041001ba65e1aea7a8d3982bb7fc2a8a561a1898d4e176a2cc4d242107b0\"), \"merkleRootQuorums\": String(\"bfe0f35ec169f3b96eb66097138e70d1e52a66a2fc31a057df6298bbbc790fce\")}), \"time\": Number(1614002775), \"mediantime\": Number(1614001062), \"nonce\": Number(43516489), \"bits\": String(\"1b6d4183\"), \"difficulty\": Number(599.8302783653238), \"chainwork\": String(\"000000000000000000000000000000000000000000000000bb39407cfc6d253a\"), \"previousblockhash\": String(\"71b81ff345f062e5c6eacbda63f64295590667a8d72428e4e71011675fe531e1\"), \"chainlock\": Bool(true)}), error: Null }") } on can_refund_htlc, retrying in 30 seconds

error: Parse(http://127.0.0.1:8888, "jsonrpc_client:183] error Error(\"invalid type: integer 43516489, expected a string\", line: 0, column: 0)

@artemii235
Copy link
Member

Arghh, let me fix this too 🙂

@artemii235
Copy link
Member

@cipig Could you retest now, please? I've just pushed the fix.

@cipig
Copy link
Member Author

cipig commented Feb 22, 2021

works now, thanks for the fix

         "event" : {
            "data" : {
               "tx_hex" : "010000000156b2621932622a5a9816874a1c4a15b2420e84aa12da8c31b9d681ae90b4a5b100000000b6473044022056eb288f58c822e218a6b6d7d7100029c4606c19bd50eeaf43bb0e8f5e115eaf02201ae5e3eebd8b94cadeb5eea3f76024a6deb2fce8e146895c629ae92b4d9d260d01514c6b6304f81c3060b17521031bb83b58ec130e28e0a6d5d2acf2eb01b0d3f1670e021d47d31db8a858219da8ac6782012088a914d6f254d5488a8415036e910b71c6c846664020cf882103683c77e807a47dcd559fa60a6510087e5c5aa0016c094cf5eb4d7e002db18e9fac68feffffff0161dc0d76000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88acf81c3060",
               "tx_hash" : "d70702994e69d4608cd4b5dcfbadad221c8af3f53fdc047dafb061d779ad9e9f"
            },
            "type" : "MakerPaymentRefunded"
         },
         "timestamp" : 1614010448360

https://explorer.firo.org/tx/d70702994e69d4608cd4b5dcfbadad221c8af3f53fdc047dafb061d779ad9e9f

@artemii235
Copy link
Member

Thanks for testing!

artemii235 added a commit that referenced this issue Feb 23, 2021
* Use H256Json as an argument for get_block.
There are many coins that support only hash as param of this RPC method.

* Fix FIRO verbose block deserialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants