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

multiple LockTime in transaction ? #44

Open
mborgatti opened this issue Dec 6, 2018 · 2 comments
Open

multiple LockTime in transaction ? #44

mborgatti opened this issue Dec 6, 2018 · 2 comments

Comments

@mborgatti
Copy link

I noticed that LockTime may be serialized in transactions multiple times at the end of each output.
Shouldn't current lines 1089-1091 be moved outside of the while loop to have a single LockTime value serialized at the end of the transaction ?

@pebwindkraft
Copy link
Owner

in tcls_sign.sh, looking at line 993, it starts to assemble the new transaction. A transaction can have multiple ($TX_IN_Count_dec) inputs, and multiple outputs ($TX_OUT_Count_dec). So from 1022-1072 it is doing all the inputs, and from 1078-1093 all the output structures. And indeed, locktime appears only once per transaction, not multiple times... In line 747 and 1012 I marked it as not being part of the loop. Good catch! I obviously only tested with single output tx. Need to fix this and add a testcase as well. thx.

@mborgatti
Copy link
Author

sure, I wanted my change back !
Any ways to make this sign script to support also :
TX_IN_Sequence=FDFFFFFF or FEFFFFFF
LockTime not zero
I tried signing a transaction that is non final and accepting the above and I get this transaction that reports a script error when referring to the UTXO from 694622290a21aea17dd71d0cf9029371be146657eb016ee4ddec82e2b1ff654d

01000000014D65FFB1E282ECDDE46E01EB576614BE719302F90C1DD77DA1AE210A29224669010000008A4730440220702dd200e5238afe01f669850678feb1cc9c481006ab8b90db523f50f5535c84022069d82dd71465a0bbfa838a93a5175b53e0c6b6e09d2ca9809e3420919de46aa5014104E934D333064E2F97C93EBF223CDC5F5D38EE69EB01FBA6C81F4655283A1760A60146D3922565F131EBFEA4D6B23029B343A849B69732DC01AC8DDE267A74A5ABFEFFFFFF02305705000000000017A914A9974100AEEE974A20CDA9A2F545704A0AB54FDC8770226600000000001976A914DBB194A78F50021822F39127C16427693DC00BC688AC55131600

error: {'message': 'the transaction was rejected by network rules.\n\n16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element

Error validating transaction: Error running script for input 0 referencing 694622290a21aea17dd71d0cf9029371be146657eb016ee4ddec82e2b1ff654d at 1: Script was NOT verified successfully..

Not sure I understand the difference required in the script

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