Skip to content

Commit

Permalink
fix zc ledger overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
goatpig committed Dec 22, 2018
1 parent b012f42 commit f2c1e37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions cppForSwig/BlockDataViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,16 @@ void BlockDataViewer::scanWallets(shared_ptr<BDV_Notification> action)
scanData.startBlock_ = *sbIter;
group.scanWallets(scanData, updateID_);

if (leVecPtr != nullptr)
sbIter++;
}

if (leVecPtr != nullptr)
{
for (auto& walletLedgerMap : scanData.saStruct_.zcLedgers_)
{
for (auto& lePair : scanData.saStruct_.zcLedgers_)
for(auto& lePair : walletLedgerMap.second)
leVecPtr->push_back(lePair.second);
}

sbIter++;
}

lastScanned_ = endBlock;
Expand Down
5 changes: 3 additions & 2 deletions cppForSwig/BtcWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ bool BtcWallet::scanWallet(ScanWalletStruct& scanInfo, int32_t updateID)
if (iter == ledgerMap.end())
continue;

scanInfo.saStruct_.zcLedgers_.insert(
make_pair(iter->first, iter->second));
auto& walletZcLedgers =
scanInfo.saStruct_.zcLedgers_[walletID()];
walletZcLedgers.insert(*iter);
}
}

Expand Down
2 changes: 1 addition & 1 deletion cppForSwig/ScrAddrObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct ScanAddressStruct
std::shared_ptr< ZeroConfSharedStateSnapshot> zcState_;

std::map<BinaryData, std::shared_ptr<std::map<BinaryData, std::shared_ptr<TxIOPair>>>> zcMap_;
std::map<BinaryData, LedgerEntry> zcLedgers_;
std::map<BinaryData, std::map<BinaryData, LedgerEntry>> zcLedgers_;
std::shared_ptr<std::map<BinaryData, std::shared_ptr<std::set<BinaryDataRef>>>> newKeysAndScrAddr_;
};

Expand Down

0 comments on commit f2c1e37

Please sign in to comment.