-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: new rpc getrawtransactionmulti #5839
Conversation
Guix Automation has failed due to the HEAD commit not being signed by an authorized core-team member. Please rebase and sign or push a new empty signed commit to allow Guix build to happen. |
Guix Automation has began to build this PR tagged as v20.1.0-devpr5839.e58c48c4. A new comment will be made when the image is pushed. |
Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v20.1.0-devpr5839.e58c48c4. The image should be on dockerhub soon. |
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.
pls see below + needs tests and maybe some release notes
src/rpc/rawtransaction.cpp
Outdated
@@ -278,7 +354,7 @@ static UniValue gettxchainlocks(const JSONRPCRequest& request) | |||
}, | |||
}, | |||
RPCResult{ | |||
RPCResult::Type::ARR, "", "Response is an array with the same size as the input txids", | |||
RPCResult::Type::OBJ_DYN, "", "Response is an array with the same size as the input txids", |
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.
?
src/txmempool.cpp
Outdated
bool CTxMemPool::getSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value) const | ||
{ | ||
LOCK(cs); | ||
mapSpentIndex::iterator it; | ||
|
||
it = mapSpent.find(key); | ||
mapSpentIndex::const_iterator it = mapSpent.find(key); |
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.
?
src/txmempool.h
Outdated
@@ -609,7 +609,7 @@ class CTxMemPool | |||
bool removeAddressIndex(const uint256 txhash); | |||
|
|||
void addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view); | |||
bool getSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value); | |||
bool getSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value) const; |
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.
?
src/rpc/rawtransaction.cpp
Outdated
continue; | ||
} | ||
|
||
for (const auto idx : irange::range(txids.size())) { |
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.
for (const auto idx : irange::range(txids.size())) { | |
for (const auto idx : irange::range(txids.size())) { |
src/rpc/rawtransaction.cpp
Outdated
CBlockIndex* blockindex{blockhash.IsNull() ? nullptr : WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(blockhash))}; | ||
if (!blockindex) { |
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.
A block hash of 0 indicates transactions not yet mined or in the mempool.
not sure if this code works correctly for this ^^^ case, needs tests
e58c48c
to
491d246
Compare
Guix Automation has began to build this PR tagged as v20.1.0-devpr5839.491d246d. A new comment will be made when the image is pushed. |
previous version had some bugs. Verbose mode didn't worked as expected, didn't worked as expected case of mempool ("0") Please, wait this build over to use it:
|
Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v20.1.0-devpr5839.491d246d. The image should be on dockerhub soon. |
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.
LGTM, utACK
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.
utACK for squash merge; the release notes are a bit bare-boned but it's ok
Issue being fixed or feature implemented
For platform needs
getrawtransactionmulti
will help to reduce amount of rpc calls for sake of performance improvement.What was done?
Implemented new RPC, basic functional test, release note.
How Has This Been Tested?
On testnet:
Breaking Changes
N/A
Checklist: