-
Notifications
You must be signed in to change notification settings - Fork 38.7k
gettxoutproof() should return consistent result #9738
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
Conversation
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this is the last txid, not the first in the list? Little confused on current behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha. Yes, you're right. This is the last transaction in the list.
%s/first/last/g my original comment
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "Not all transactions found in the retrieved block" since this can happen when it is unspecified as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to "Not all transactions found in the specified or retrieved block"
20eaa35 to
5dca91d
Compare
|
utACK 5dca91d5cf8dfc99343c6e18a223504049a7f68b (assuming the test is fixed - it looks like it was just the string was changed in code but the RPC test's check for string didnt get updated - yay for tests testing things 👍 ) |
5dca91d to
8bedc2b
Compare
|
ok, should be fixed. #9707 has now been merged so this PR nwo contains only the relevant commit. |
8bedc2b to
b3b28a2
Compare
|
rebased |
|
Needs rebase |
0a6ab2e to
ae69c38
Compare
|
rebased |
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the nHeight checks are a mistranslation to per-utxo, so should just be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed
We can call gettxoutproof() with a list of transactions. Currently, if the first transaction is unspent (and all other transactions are in the same block), then the call will succeed. If the first transaction has been spent, then the call will fail. The means that the following two calls will return different results: gettxoutproof(unspent_tx1, spent_tx1) gettxoutproof(spent_tx1, unspent_tx1) This commit makes behaviour independent of transaction ordering by looping through all transactions provided and trying to find which block they're in. This commit also increases the test coverage and tests more failure cases for gettxoutproof()
ae69c38 to
6294f32
Compare
|
utACK 6294f32 |
6294f32 gettxoutproof() should return consistent result (John Newbery) Tree-SHA512: 1c36f78ea07a3bdde09e9494207b4372d54bcd94ed2d56e339e78281f6693e26a93e4c3123453d5c0f6e994d0069d5a1c806786c4af71864f87ea4841611c379
6294f32 gettxoutproof() should return consistent result (John Newbery) Tree-SHA512: 1c36f78ea07a3bdde09e9494207b4372d54bcd94ed2d56e339e78281f6693e26a93e4c3123453d5c0f6e994d0069d5a1c806786c4af71864f87ea4841611c379
We can call gettxoutproof() with a list of transactions. Currently, if
the first transaction is unspent (and all other transactions are in the
same block), then the call will succeed. If the first transaction has
been spent, then the call will fail. The means that the following two
calls will return different results:
gettxoutproof(unspent_tx1, spent_tx1)gettxoutproof(spent_tx1, unspent_tx1)This commit makes behaviour independent of transaction ordering by looping
through all transactions provided and trying to find which block they're in.
This commit also increases the test coverage and tests more failure
cases for gettxoutproof()
Note to reviewers: builds on #9707 - please review only the second commit in this PR.