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

litecoin-cli giving false information? :/ #529

Closed
quantaf1re opened this issue Aug 18, 2018 · 2 comments
Closed

litecoin-cli giving false information? :/ #529

quantaf1re opened this issue Aug 18, 2018 · 2 comments

Comments

@quantaf1re
Copy link

Hey guys, got a strange one here... I've been parsing Litecoin through the whole blockchain and have run into errors with a couple of transactions. Basically, it gives mostly false data - there are no inputs, value is wrong etc. Strangely, the txid is the same as the hash (which it shouldn't be - calling this tx with the 'true' txid is what pulls this data and shows the incorrect txid in the result). Maybe because there's no witness data in this result? Just guessing there.
The other strange thing is that I have 2 nodes running. Both nodes are returning the same incorrect information for the same tx's. They return the data perfectly fine for other tx's. I highly doubt that's a coincidence, but I thought a node is supposed to gather data from 8 other nodes when syncing the chain? My nodes are physically very close, so my only thought is that the 2nd node got all (or most) of its block from my 1st node?
I'm running litecoin-0.16.0-x86_64-linux-gnu downloaded from the website
To reproduce - just run the same rpc commands
2 Examples.
Example 1:
txid = a4b7fd54fe5f149ca34f248696fe706bcf9c358d47b6cee0d18bcbeee9db3dbd
On 2 explorers:
https://chainz.cryptoid.info/ltc/tx.dws?a4b7fd54fe5f149ca34f248696fe706bcf9c358d47b6cee0d18bcbeee9db3dbd.htm
https://chain.so/api/v2/tx/LTC/a4b7fd54fe5f149ca34f248696fe706bcf9c358d47b6cee0d18bcbeee9db3dbd

My rpc commands and its results:

~/litecoin-0.16.0/bin$ ./litecoin-cli --rpcuser=xxx --rpcpassword=xxx --rpcport=xxx --rpcconnect=xxx getrawtransaction a4b7fd54fe5f149ca34f248696fe706bcf9c358d47b6cee0d18bcbeee9db3dbd
01000000000101e010790e52239fcd4090fb5268994f271eaa1e97fa39f0ed9429def16b3022680000000000ffffffff02d05f98000000000017a914631e191027e407a30eee747dc8f168b826aa4f5f87a49c000000000000160014f0b439274270385364f753e8c379ac6e591bbc1a02483045022100b2d1f363b4f1f721173487d420163b4dfd32cafda732552027ed2e41fdf8522a02205f5a5116728c892d8376bff4b66e1823e3c7e23e139d32421436e7229317494d012103ccb1b5951a6ccd9159deec82545d07f2e380e70e07373548eeaa41d3dacca0a900000000

~/litecoin-0.16.0/bin$ ./litecoin-cli --rpcuser=xxx --rpcpassword=xxx --rpcport=xxx --rpcconnect=xxx decoderawtransaction 01000000000101e010790e52239fcd4090fb5268994f271eaa1e97fa39f0ed9429def16b3022680000000000ffffffff02d05f98000000000017a914631e191027e407a30eee747dc8f168b826aa4f5f87a49c000000000000160014f0b439274270385364f753e8c379ac6e591bbc1a02483045022100b2d1f363b4f1f721173487d420163b4dfd32cafda732552027ed2e41fdf8522a02205f5a5116728c892d8376bff4b66e1823e3c7e23e139d32421436e7229317494d012103ccb1b5951a6ccd9159deec82545d07f2e380e70e07373548eeaa41d3dacca0a900000000
{
"txid": "006088188fa6d73b4bba43df91e36fba70fa02532732e75d4aa18681167b35b5",
"hash": "006088188fa6d73b4bba43df91e36fba70fa02532732e75d4aa18681167b35b5",
"version": 1,
"size": 224,
"vsize": 224,
"locktime": 0,
"vin": [
],Z
"vout": [
{
"value": -69796447753.79967999,
"n": 0,
"scriptPubKey": {
"asm": "90fb5268994f271eaa1e97fa39f0ed9429def16b3022680000000000ffffffff02d05f98000000000017a914631e191027e407a30eee747dc8f168b826aa4f5f OP_EQUAL OP_MAX OP_NUMEQUAL 0 0 0 0 0 0 0014f0b439274270385364f753e8c379ac6e591bbc1a 12360 022100b2d1f363b4f1f721173487d420163b4dfd32cafda732552027ed2e41fdf8522a02205f5a5116728c892d8376bff4b66e1823e3c7e23e139d32421436e7229317494d 33 -3518924 OP_MUL 6ccd9159deec82545d07f2e380e70e07373548eeaa41d3dacca0 OP_HASH160",
"hex": "4090fb5268994f271eaa1e97fa39f0ed9429def16b3022680000000000ffffffff02d05f98000000000017a914631e191027e407a30eee747dc8f168b826aa4f5f87a49c000000000000160014f0b439274270385364f753e8c379ac6e591bbc1a02483045022100b2d1f363b4f1f721173487d420163b4dfd32cafda732552027ed2e41fdf8522a02205f5a5116728c892d8376bff4b66e1823e3c7e23e139d32421436e7229317494d012103ccb1b5951a6ccd9159deec82545d07f2e380e70e07373548eeaa41d3dacca0a9",
"type": "nonstandard"
}
}
]
}

Example 2:
txid = 0a5c62f16623956f529c9b5fd62580e71a1dd8fa2a86d98dd6772589fef2e97c
https://chainz.cryptoid.info/ltc/tx.dws?0a5c62f16623956f529c9b5fd62580e71a1dd8fa2a86d98dd6772589fef2e97c.htm
https://chain.so/api/v2/tx/LTC/0a5c62f16623956f529c9b5fd62580e71a1dd8fa2a86d98dd6772589fef2e97c

My rpc commands and results:
~/litecoin-0.16.0/bin$ ./litecoin-cli --rpcuser=xxx --rpcpassword=xxx --rpcport=xxx --rpcconnect=xxx getrawtransaction 0a5c62f16623956f529c9b5fd62580e71a1dd8fa2a86d98dd6772589fef2e97c
010000000001019be9e1ef2ee29ee5a9556444999eb055d0e954e288f5b1845a7bb4d3567bd2f50100000017160014093c79f1986f9cb3042ca318ce47fd850c0840b2ffffffff02560d340000000000160014629970f72398c97ef31e23e7a6a1eceb39e3d6fe326c3105000000001976a914ed60bdb6ad828cf1b84f2d38ffac319ab1cee16088ac0247304402200b11e6361fc31b526c75c418f70a9d8e5a3d79f6e0b482207d54588057a546150220461863db6fcab7b92c0939ac5ad125a42519c6df08916cffaef7081725b2bcc40121039d6695322b82a32df4968eeae21ad5c9c5c809c6e34efb9c00598aa296d0b70100000000

~/litecoin-0.16.0/bin$ ./litecoin-cli --rpcuser=xxx --rpcpassword=xxx --rpcport=xxx --rpcconnect=xxx decoderawtransaction 010000000001019be9e1ef2ee29ee5a9556444999eb055d0e954e288f5b1845a7bb4d3567bd2f50100000017160014093c79f1986f9cb3042ca318ce47fd850c0840b2ffffffff02560d340000000000160014629970f72398c97ef31e23e7a6a1eceb39e3d6fe326c3105000000001976a914ed60bdb6ad828cf1b84f2d38ffac319ab1cee16088ac0247304402200b11e6361fc31b526c75c418f70a9d8e5a3d79f6e0b482207d54588057a546150220461863db6fcab7b92c0939ac5ad125a42519c6df08916cffaef7081725b2bcc40121039d6695322b82a32df4968eeae21ad5c9c5c809c6e34efb9c00598aa296d0b70100000000
{
"txid": "cd57b05239dd4c26ab449be6daa4f4128ad742bd6604ef60def4473ec35506be",
"hash": "cd57b05239dd4c26ab449be6daa4f4128ad742bd6604ef60def4473ec35506be",
"version": 1,
"size": 248,
"vsize": 248,
"locktime": 0,
"vin": [
],
"vout": [
{
"value": -69979792631.58084863,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 5 OP_NOTIF 999eb055d0e954e288f5b1845a7bb4d3567bd2f50100000017160014093c79f1986f9cb3042ca318ce47fd850c0840b2ffffffff02560d340000000000160014629970f7 98c97ef31e23e7a6a1eceb39e3d6fe326c3105000000001976a914ed60bdb6ad828cf1 OP_NOP9 -1 38ffac319ab1cee16088ac0247304402200b11e6361fc31b526c75c418f70a9d8e5a3d79f6e0b482207d545880 7 OP_WITHIN 150220461863db6fcab7b92c0939ac5ad125a42519c6df08916cffaef7081725b2bcc40121039d6695322b82a32df4968eeae21ad5c9c5c809c6e34efb9c00598aa296d0b701",
"hex": "a9556444999eb055d0e954e288f5b1845a7bb4d3567bd2f50100000017160014093c79f1986f9cb3042ca318ce47fd850c0840b2ffffffff02560d340000000000160014629970f72398c97ef31e23e7a6a1eceb39e3d6fe326c3105000000001976a914ed60bdb6ad828cf1b84f2d38ffac319ab1cee16088ac0247304402200b11e6361fc31b526c75c418f70a9d8e5a3d79f6e0b482207d54588057a546150220461863db6fcab7b92c0939ac5ad125a42519c6df08916cffaef7081725b2bcc40121039d6695322b82a32df4968eeae21ad5c9c5c809c6e34efb9c00598aa296d0b701",
"type": "nonstandard"
}
}
]
}

Thanks in advance for any help working out what the issue is here! :slight_smile:

@thrasher-
Copy link
Member

Hey @quantaf1re,

decoderawtransaction has a 2nd parameter for setting whether or not the transaction is a serialised witness transaction, in this example it is, so setting this to true will give you the correct output. If it is not specified, it will attempt to use heuristics to parse it.

@thrasher-
Copy link
Member

Closed due to inactivity, but please reopen if you wish to pursue this issue.

thrasher- pushed a commit to thrasher-/litecoin that referenced this issue Dec 6, 2019
b19c000 Merge litecoin-project#607: Use size_t shifts when computing a size_t
4d01bc2 Merge litecoin-project#606: travis: Remove unused sudo:false
e6d01e9 Use size_t shifts when computing a size_t
7667532 travis: Remove unused sudo:false
ee99f12 Merge litecoin-project#599: Switch x86_64 asm to use "i" instead of "n" for immediate values.
d58bc93 Switch x86_64 asm to use "i" instead of "n" for immediate values.
05362ee Merge litecoin-project#597: Add $(COMMON_LIB) to exhaustive tests to fix ARM asm build
8348386 Add $(COMMON_LIB) to exhaustive tests to fix ARM asm build
aa15154 Merge litecoin-project#568: Fix integer overflow in ecmult_multi_var when n is large
2277af5 Fix integer overflow in ecmult_multi_var when n is large
85d0e1b Merge litecoin-project#591: Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing.
1419637 Merge litecoin-project#580: Add trivial ecmult_multi algorithm which does not require a scratch space
a697d82 Add trivial ecmult_multi to the benchmark tool
bade617 Add trivial ecmult_multi algorithm. It is selected when no scratch space is given and just multiplies and adds the points.
5545e13 Merge litecoin-project#584: configure: Use CFLAGS_FOR_BUILD when checking native compiler
20c5869 Merge litecoin-project#516: improvements to random seed in src/tests.c
b76e45d Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing.
870a977 Merge litecoin-project#562: Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse
be40c4d Fixup for C90 mixed declarations.
c71dd2c Merge litecoin-project#509: Fix algorithm selection in bench_ecmult
6492bf8 Merge litecoin-project#518: Summarize build options after running configure
0e9ada1 Merge litecoin-project#567: Correct order of libs returned on pkg-config --libs --static libsecp2…
e96901a Merge litecoin-project#587: Make randomization of a non-signing context a noop
58df8d0 Merge litecoin-project#511: Portability fix for the configure scripts generated
2ebdad7 Merge litecoin-project#552: Make constants static:
1c131af Merge litecoin-project#551: secp256k1_fe_sqrt: Verify that the arguments don't alias.
ba698f8 Merge litecoin-project#539: Assorted minor corrections
949e85b Merge litecoin-project#550: Optimize secp256k1_fe_normalize_weak calls.
a34bcaa Actually pass CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD to linker
2d5f4ce configure: Use CFLAGS_FOR_BUILD when checking native compiler
b408c6a Merge litecoin-project#579: Use __GNUC_PREREQ for detecting __builtin_expect
6198375 Make randomization of a non-signing context a noop
c663397 Use __GNUC_PREREQ for detecting __builtin_expect
e34ceb3 Merge litecoin-project#557: Eliminate scratch memory used when generating contexts
b3bf5f9 ecmult_impl: expand comment to explain how effective affine interacts with everything
efa783f Store z-ratios in the 'x' coord they'll recover
ffd3b34 add `secp256k1_ge_set_all_gej_var` test which deals with many infinite points
84740ac ecmult_impl: save one fe_inv_var
4704527 ecmult_impl: eliminate scratch memory used when generating context
7f7a2ed ecmult_gen_impl: eliminate scratch memory used when generating context
314a61d Merge litecoin-project#553: add static context object which has no capabilities
89a20a8 Correct order of libs returned on pkg-config --libs --static libsecp256k1 call.
1086fda Merge litecoin-project#354: [ECDH API change] Support custom hash function
d3cb1f9 Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse
40fde61 prevent attempts to modify `secp256k1_context_no_precomp`
ed7c084 add static context object which has no capabilities
496c5b4 Make constants static: static const secp256k1_ge secp256k1_ge_const_g; static const int CURVE_B;
bf8b86c secp256k1_fe_sqrt: Verify that the arguments don't alias.
9bd89c8 Optimize secp256k1_fe_normalize_weak calls. Move secp256k1_fe_normalize_weak calls out of ECMULT_TABLE_GET_GE and ECMULT_TABLE_GET_GE_STORAGE and into secp256k1_ge_globalz_set_table_gej instead.
52ab96f clean dependendies in field_*_impl.h
deff5ed Correct math typos in field_*.h
4efb3f8 Add check that restrict pointers don't alias with all parameters.
1e6f1f5 Merge litecoin-project#529: fix tests.c in the count == 0 case
c8fbc3c [ECDH API change] Allow pass arbitrary data to hash function
b00be65 [ECDH API change] Support custom hash function
95e99f1 fix tests.c in the count == 0 case
452d8e4 Merge litecoin-project#523: scratch: add stack frame support
6fe5043 scratch: add stack frame support
9bc2e26 Merge litecoin-project#522: parameterize ecmult_const over input size
7c1b91b parameterize ecmult_const over input size
dbc3ddd Merge litecoin-project#513: Increase sparsity of pippenger fixed window naf representation
3965027 Summarize build options in configure script
0f05173 Fix algorithm selection in bench_ecmult
fb9271d Merge litecoin-project#510: add a couple missing `const`s to ecmult_pippenger_wnaf
cd5f602 Merge litecoin-project#515: Fix typo
09146ae Merge litecoin-project#512: secp256k1_ec_privkey_negate - fix documentation
ec0a7b3 Don't touch leading zeros in wnaf_fixed.
9e36d1b Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar.
96f68a0 Don't invert scalar in wnaf_fixed when it is even because a caller might intentionally give a scalar with many leading zeros.
8b3841c fix bug in fread() failure check
cddef0c tests: add warning message when /dev/urandom fails
9b7c47a Fix typo
6dbb007 Increase sparsity of pippenger fixed window naf representation
1646ace secp256k1_ec_privkey_negate - fix documentation
270f6c8 Portability fix for the configure scripts generated
9b3ff03 add a couple missing `const`s to ecmult_pippenger_wnaf
cd329db Merge litecoin-project#460: [build] Update ax_jni_include_dir.m4 macro
7f9c1a1 Merge litecoin-project#498: tests: Avoid calling fclose(...) with an invalid argument
f99aa8d Merge litecoin-project#499: tests: Make sure we get the requested number of bytes from /dev/urandom
b549d3d Merge litecoin-project#472: [build] Set --enable-jni to no by default instead of auto.
d333521 Merge litecoin-project#494: Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS
2ef8ea5 Merge litecoin-project#495: Add bench_ecmult to .gitignore
82a96e4 tests: Make sure we get the requested number of bytes from /dev/urandom
5aae5b5 Avoid calling fclose(...) with an invalid argument
cb32940 Add bench_ecmult to .gitignore
31abd3a Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS
c95f6f1 Merge litecoin-project#487: fix tests typo, s/changed/unchanged
fb46c83 Merge litecoin-project#463: Reduce usage of hardcoded size constants
02f5001 Merge litecoin-project#490: Disambiguate bench functions and types
1f46d60 Disambiguate bench functions and types
f54c6c5 Merge litecoin-project#480: Enable benchmark building by default
c77fc08 Merge litecoin-project#486: Add pippenger_wnaf for multi-multiplication
d2f9c6b Use more precise pippenger bucket windows
4c950bb Save some additions per window in _pippenger_wnaf
a58f543 Add flags for choosing algorithm in ecmult_multi benchmark
36b22c9 Use scratch space dependent batching in ecmult_multi
355a38f Add pippenger_wnaf ecmult_multi
bc65aa7 Add bench_ecmult
dba5471 Add ecmult_multi tests
8c1c831 Generalize Strauss to support multiple points
548de42 add resizeable scratch space API
0e96cdc fix typo, s/changed/unchanged
c7680e5 Reduce usage of hardcoded size constants
6ad5cdb Merge litecoin-project#479: Get rid of reserved _t in type names
7a78f60 Print whether we're building benchmarks
4afec9f Build benchmarks by default
d1dc9df Get rid of reserved _t in type names
57752d2 [build] Set --enable-jni to no by default instead of auto.
e7daa9b [build] Tweak JNI macro to warn instead of error for JNI not found.
5b22977 [build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS

git-subtree-dir: src/secp256k1
git-subtree-split: b19c000
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

No branches or pull requests

2 participants