uaktags / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Sync Issue TX not found #55

Closed TRBO-Coin closed 4 years ago

TRBO-Coin commented 4 years ago

I am using master branch last commit july 2019 and latest nodjs and mongodb but for some reason when i try to sync the explorer with the wallet i get the following error.

tx not found: 7c8db41e3384232648be8d833f30603dd30aa208811e0b93a0f7d96af32ff626

and output from explorer is

GET /api/getrawtransaction?txid=7c8db41e3384232648be8d833f30603dd30aa208811e0b93a0f7d96af32ff626&decrypt=1 200 2.853 ms - 39 { name: 'SyntaxError', message: 'Duplicate key "hex"', at: 2016, text: '[{"result":{"hex":"0100000001fa686755504a0dbbe8cac35e3f033e47b3d64f293dee0e64899599e175ab546a020000004847304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01ffffffff0400000000000000000040c2ad74610100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac4034371d180100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac008e7657490000001976a91402d4e232808e04af604d990c6be0693be673fddb88ac00000000","txid":"7cbc2a2e4cb204c227048e9ecfc742259b618ecc11edfd04b7b06b59c10b3e5a","version":1,"size":254,"locktime":0,"vin":[{"txid":"6a54ab75e1999589640eee3d294fd6b3473e033f5ec3cae8bb0d4a50556768fa","vout":2,"scriptSig":{"asm":"304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01","hex":"47304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01"},"sequence":4294967295}],"vout":[{"value":0.00,"n":0,"scriptPubKey":{"asm":"","hex":"","type":"nonstandard"}},{"value":15180.81,"n":1,"scriptPubKey":{"asm":"024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28 OP_CHECKSIG","hex":"21024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac","reqSigs":1,"type":"pubkey","addresses":["TSvM6H7tmdQnqL6bJMc1YAXskCtESeuWkn"]}},{"value":12030.81,"n":2,"scriptPubKey":{"asm":"024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28 OP_CHECKSIG","hex":"21024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac","reqSigs":1,"type":"pubkey","addresses":["TSvM6H7tmdQnqL6bJMc1YAXskCtESeuWkn"]}},{"value":3150.00,"n":3,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 02d4e232808e04af604d990c6be0693be673fddb OP_EQUALVERIFY OP_CHECKSIG","hex":"76a91402d4e232808e04af604d990c6be0693be673fddb88ac","reqSigs":1,"type":"pubkeyhash","addresses":["TAEBNrSqcHzpBBzvhUxW6ENd9HW8zZ37gx"]}}],"hex":"0100000001fa686755504a0dbbe8cac35e3f033e47b3d64f293dee0e64899599e175ab546a020000004847304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01ffffffff0400000000000000000040c2ad74610100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac4034371d180100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac008e7657490000001976a91402d4e232808e04af604d990c6be0693be673fddb88ac00000000","blockhash":"68b85bb9eb276c542ab516c3a7ebec4a3fe65846b0b2668a3a96198c79c7234e","confirmations":51759,"time":1574971263,"blocktime":1574971263},"error":null,"id":"1579806226047-0"}]\n'

I know in a previous issue this was mentioned but unsure if it was fixed, i don't have the time issue as it's only in the source code once.

Any help with is is appreciated, i am using master as it has masternode page, seems other branches do not.

I have noticed that decrypt=1 on the api url generates an error check console not sure if that is the issue

uaktags commented 4 years ago

I can say that this entire fork is basically dead in the water as we finally have momentum in the project to do these implementations cleaning.

Unfortunately, this isn't really even a my fork vs original fork issue. The problem is indeed your coin's dupelicate "hex" parameter:

[{
    "result": {
        "hex": "0100000001fa686755504a0dbbe8cac35e3f033e47b3d64f293dee0e64899599e175ab546a020000004847304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01ffffffff0400000000000000000040c2ad74610100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac4034371d180100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac008e7657490000001976a91402d4e232808e04af604d990c6be0693be673fddb88ac00000000",
        "txid": "7cbc2a2e4cb204c227048e9ecfc742259b618ecc11edfd04b7b06b59c10b3e5a",
        "version": 1,
        "size": 254,
        "locktime": 0,
        //VIN and VOUT removed
        "hex": "0100000001fa686755504a0dbbe8cac35e3f033e47b3d64f293dee0e64899599e175ab546a020000004847304402207f7461039c2cb41aa93abaf6968e46debd0957755b5ff6ff787206c1883272760220296f953d16beee27d809c50ab7922e8ec19a8c816127631ea37416ca18714fef01ffffffff0400000000000000000040c2ad74610100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac4034371d180100002321024741fb6295715085a4b0d93536f564cc922ad2a0663cf65c136d06dc4b2b2d28ac008e7657490000001976a91402d4e232808e04af604d990c6be0693be673fddb88ac00000000",
        "blockhash": "68b85bb9eb276c542ab516c3a7ebec4a3fe65846b0b2668a3a96198c79c7234e",
        "confirmations": 51759,
        "time": 1574971263,
        "blocktime": 1574971263
    },
    "error": null,
    "id": "1579806226047-0"
}]

because of this, the node module that's grabbing the information "bitcoin-node-api" and/or "bitcoin-core" fails because it's not properly handling the fact that the json is invalid (nor should it have it...the json shouldn't be invalid). It's really the problem of the coind and they should be the ones fixing their API to be valid rather than us trying to code around it

TRBO-Coin commented 4 years ago

Strange as the explorer worked before with an exact copy of this current coin, so does not make sense how it has duplicate hex output.

ooh well on to something else, thanks for the reply

uaktags commented 4 years ago

Unfortunately I can only go off of what I see and the output you provided indicates a very common issue we see with different coins that use invalid json formats.

Goodluck!