use original height for seq parameter in RPC

This commit is contained in:
Brannon King 2020-01-08 16:12:06 -07:00
parent 8743a93c9f
commit 225ffed5da
2 changed files with 3 additions and 5 deletions

View file

@ -124,9 +124,7 @@ std::vector<CClaimNsupports> seqSort(const std::vector<CClaimNsupports>& source)
auto claimsNsupports = source; auto claimsNsupports = source;
std::sort(claimsNsupports.begin(), claimsNsupports.end(), [](const CClaimNsupports& lhs, const CClaimNsupports& rhs) { std::sort(claimsNsupports.begin(), claimsNsupports.end(), [](const CClaimNsupports& lhs, const CClaimNsupports& rhs) {
auto& lc = lhs.claim; return lhs.originalHeight < rhs.originalHeight || (lhs.originalHeight == rhs.originalHeight && lhs.claim < rhs.claim);
auto& rc = rhs.claim;
return lc.nHeight < rc.nHeight || (lc.nHeight == rc.nHeight && lc.outPoint.n < rc.outPoint.n);
}); });
return claimsNsupports; return claimsNsupports;

View file

@ -238,8 +238,8 @@ BOOST_AUTO_TEST_CASE(hash_bid_seq_claim_changes_test)
auto claimId4 = ClaimIdHash(tx3.GetHash(), 0); auto claimId4 = ClaimIdHash(tx3.GetHash(), 0);
int claim1bid = 3, claim1seq = 0; int claim1bid = 3, claim1seq = 0;
int claim2bid = 1, claim2seq = 1; int claim2bid = 1, claim2seq = 2;
int claim3bid = 2, claim3seq = 2; int claim3bid = 2, claim3seq = 1;
int claim4bid = 0, claim4seq = 3; int claim4bid = 0, claim4seq = 3;
auto getclaimsforname = tableRPC["getclaimsforname"]->actor; auto getclaimsforname = tableRPC["getclaimsforname"]->actor;