From 2a0f8b224d3a2e0137410f1f96577be19b913dc5 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 8 Mar 2013 20:47:41 -0800 Subject: [PATCH] Make sure OwnerCount adjustments are stored. --- src/cpp/ripple/LedgerEntrySet.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/LedgerEntrySet.cpp b/src/cpp/ripple/LedgerEntrySet.cpp index 6dc7b87bb..7114b68f8 100644 --- a/src/cpp/ripple/LedgerEntrySet.cpp +++ b/src/cpp/ripple/LedgerEntrySet.cpp @@ -893,8 +893,15 @@ void LedgerEntrySet::ownerCountAdjust(const uint160& uOwnerID, int iAmount, SLE: const uint32 uOwnerCount = sleRoot->getFieldU32(sfOwnerCount); - if (iAmount + int(uOwnerCount) >= 0) + const uint32 uNew = iAmount + int(uOwnerCount) > 0 + ? uOwnerCount+iAmount + : 0; + + if (uOwnerCount != uNew) + { sleRoot->setFieldU32(sfOwnerCount, uOwnerCount+iAmount); + entryModify(sleRoot); + } } TER LedgerEntrySet::offerDelete(SLE::ref sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID)