gcarq / rusty-blockparser

Bitcoin Blockchain Parser written in Rust language
GNU General Public License v3.0
370 stars 145 forks source link

txid's missing a character in unspentcsvdump output #36

Closed mjmckinnon closed 4 years ago

mjmckinnon commented 6 years ago

All txid's output in the unspentcsvdump are missing a character, due to this mistake: let txid = &key[0..63];

Instead it should be: let txid = &key[0..64];

https://github.com/gcarq/rusty-blockparser/blob/119955b71e6f0aff9f655ebea0069458ecca9d05/src/callbacks/unspentcsvdump.rs#L143

ghost commented 6 years ago

+1 not just txids but indexOut's last int is also missing in many cases.

e.g.

[root@btcnode release]# tail unspent-0-502867.csv
b9057ea0c4e98afb15fd1091ad68c54f20d59b72726c3925e8a7395cd9e9dde;;319512;22370;189EmHb2pGarEdUidS1oASU98azgSM5Yy
f5e4d0fac9ea92381fbd08a0f124106349bff6eb91127ed3d6e6fb619f8e22f;21;379702;22550;185tvuruEdEfTNwffJ69Wqok3NX3Zzg3M8
4fe3d4605efe0ea2f4d88e1206357af72298b107f656d997f6971fbe5bb9c49;1;341334;16026;1GJDmHQYwXMte9kCW5E3bYLRVEQy7enypW
f1fef8045f8a41448dbb00a1e951ed8fc7936b33c785892bbb26078feb0ad5c;;429551;222900915;1Hd1kYohhSTGN8UE2mSTyBU2kpqGrDsBYA
18b810ced9f06696a54c7e5d84869982a6cb73c6303e61ffac46af988b40ab5;15;493988;1184921;1GNrU1542CYpbpKSYhdSftquZWvMcWYbHj
e4528a324c6052692b55c32a898e049b1ab53ac44539dc3a087842f2ff7f1fc;64;371172;20054;1NY3Q9CbbZgtjGryini292wWFNya7AxCdF
1a51192f5c0fdf47f153d2dceb06b4e1fcab214e6ae6c02424e3789f9ee0a72;39;291248;86082;14E1evPCQxXY4ybrWrLuPrTW9G42RCUk1i
757562a67b791b084093e7d7d9d9f17aa921490754ea7d5a92b436f6fd697de;;488332;2035;13uAJ3E3bPuGLyFygm7iwhYBnmZhSgqAx6
77adf43fb649ec056e5fe5933fb4056b15b38fe2afa7cbfbcc7cc42f43f5c70;;409392;6000;14qBPcnG3RwYpFZhYqghwpUm3YShmziy2v
eaa90b7fa86355ca8787118e70a2af10d9099902dd6f15f41fe3410f335aadc;167;202901;5000;1MzXzuNwwzY3Sk4AhFBYq5P3vEFuvxGfq2

we take last txid eaa90b7fa86355ca8787118e70a2af10d9099902dd6f15f41fe3410f335aadc

correct is

eaa90b7fa86355ca8787118e70a2af10d9099902dd6f15f41fe3410f335aadcf

last tx's indexOut 167 correct is

"n":1679, ref: https://blockchain.info/tx/eaa90b7fa86355ca8787118e70a2af10d9099902dd6f15f41fe3410f335aadcf?format=json

hope this helps.,

gcarq commented 4 years ago

Thanks! This should be fixed