Skip to content

Commit 3bd0730

Browse files
Refactor getusedcoinstagstxhashes to use GetSpendsMobile (#1773)
* Refactor getusedcoinstagstxhashes to use GetSpendsMobile for tag retrieval Updated the getusedcoinstagstxhashes function to replace the use of GetSpends with GetSpendsMobile, changing the data structure from an unordered_map to a vector of pairs for improved performance and compatibility. * Enforce mobile mode requirement in getusedcoinstagstxhashes Added a check in the getusedcoinstagstxhashes function to ensure that the application is run with the -mobile flag. If the flag is not set, an error is thrown prompting the user to rerun with the appropriate argument.
1 parent 4b5a854 commit 3bd0730

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/rpc/misc.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,12 +1586,16 @@ UniValue getusedcoinstagstxhashes(const JSONRPCRequest& request)
15861586
throw std::runtime_error(std::string("An exception occurred while parsing parameters: ") + e.what());
15871587
}
15881588

1589+
if(!GetBoolArg("-mobile", false)) {
1590+
throw std::runtime_error(std::string("Please rerun Firo with -mobile "));
1591+
}
1592+
15891593
spark::CSparkState* sparkState = spark::CSparkState::GetState();
1590-
std::unordered_map<GroupElement, int, spark::CLTagHash> tags;
1594+
std::vector<std::pair<GroupElement, int>> tags;
15911595
std::unordered_map<uint256, uint256> ltagTxhash;
15921596
{
15931597
LOCK(cs_main);
1594-
tags = sparkState->GetSpends();
1598+
tags = sparkState->GetSpendsMobile();
15951599
ltagTxhash = sparkState->GetSpendTxIds();
15961600
}
15971601
UniValue serializedTagsTxIds(UniValue::VARR);

0 commit comments

Comments
 (0)