Update `CFuturesUserKey` to have `owner` as the first
- Dominant language
- C++
- Stars
- 397
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
#### What would you like to be added:
currently
```
struct CFuturesUserKey {
uint32_t height;
CScript owner;
uint32_t txn;
```
update it to
```
struct CFuturesUserKey {
CScript owner;
uint32_t height;
uint32_t txn;
```
#### Why is this needed:
Improves perf for `getpendingfutureswaps` RPC.
currently `ForEachFuturesUserValues ` is used in following locations
https://github.com/DeFiCh/ain/blob/e63ae12e399b846c5f97dbf3cb1e771f75263255/src/validation.cpp#L3354
https://github.com/DeFiCh/ain/blob/e63ae12e399b846c5f97dbf3cb1e771f75263255/src/validation.cpp#L3407
https://github.com/DeFiCh/ain/blob/e63ae12e399b846c5f97dbf3cb1e771f75263255/src/validation.cpp#L3434
should not be a problem if we change the index order.
Contributor guide
Assessment
This issue has not been assessed yet.