Fix code review nits.
This commit is contained in:
@@ -474,11 +474,10 @@ void CWallet::ChainTip(const CBlockIndex *pindex,
|
|||||||
{
|
{
|
||||||
if (added) {
|
if (added) {
|
||||||
IncrementNoteWitnesses(pindex, pblock, sproutTree, saplingTree);
|
IncrementNoteWitnesses(pindex, pblock, sproutTree, saplingTree);
|
||||||
UpdateSaplingNullifierNoteMapForBlock(pblock);
|
|
||||||
} else {
|
} else {
|
||||||
DecrementNoteWitnesses(pindex);
|
DecrementNoteWitnesses(pindex);
|
||||||
UpdateSaplingNullifierNoteMapForBlock(pblock);
|
|
||||||
}
|
}
|
||||||
|
UpdateSaplingNullifierNoteMapForBlock(pblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWallet::SetBestChain(const CBlockLocator& loc)
|
void CWallet::SetBestChain(const CBlockLocator& loc)
|
||||||
@@ -758,6 +757,15 @@ void CWallet::AddToSproutSpends(const uint256& nullifier, const uint256& wtxid)
|
|||||||
SyncMetaData<uint256>(range);
|
SyncMetaData<uint256>(range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWallet::AddToSaplingSpends(const uint256& nullifier, const uint256& wtxid)
|
||||||
|
{
|
||||||
|
mapTxSaplingNullifiers.insert(make_pair(nullifier, wtxid));
|
||||||
|
|
||||||
|
pair<TxNullifiers::iterator, TxNullifiers::iterator> range;
|
||||||
|
range = mapTxSaplingNullifiers.equal_range(nullifier);
|
||||||
|
SyncMetaData<uint256>(range);
|
||||||
|
}
|
||||||
|
|
||||||
void CWallet::AddToSpends(const uint256& wtxid)
|
void CWallet::AddToSpends(const uint256& wtxid)
|
||||||
{
|
{
|
||||||
assert(mapWallet.count(wtxid));
|
assert(mapWallet.count(wtxid));
|
||||||
@@ -778,15 +786,6 @@ void CWallet::AddToSpends(const uint256& wtxid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWallet::AddToSaplingSpends(const uint256& nullifier, const uint256& wtxid)
|
|
||||||
{
|
|
||||||
mapTxSaplingNullifiers.insert(make_pair(nullifier, wtxid));
|
|
||||||
|
|
||||||
pair<TxNullifiers::iterator, TxNullifiers::iterator> range;
|
|
||||||
range = mapTxSaplingNullifiers.equal_range(nullifier);
|
|
||||||
SyncMetaData<uint256>(range);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWallet::ClearNoteWitnessCache()
|
void CWallet::ClearNoteWitnessCache()
|
||||||
{
|
{
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
@@ -1226,14 +1225,14 @@ void CWallet::UpdateSaplingNullifierNoteMapWithTx(CWalletTx& wtx) {
|
|||||||
SaplingOutPoint op = item.first;
|
SaplingOutPoint op = item.first;
|
||||||
SaplingNoteData nd = item.second;
|
SaplingNoteData nd = item.second;
|
||||||
|
|
||||||
if (nd.witnesses.size() == 0) {
|
if (nd.witnesses.empty()) {
|
||||||
// If there are no witnesses, erase the nullifier and associated mapping.
|
// If there are no witnesses, erase the nullifier and associated mapping.
|
||||||
if (item.second.nullifier) {
|
if (item.second.nullifier) {
|
||||||
mapSaplingNullifiersToNotes.erase(item.second.nullifier.get());
|
mapSaplingNullifiersToNotes.erase(item.second.nullifier.get());
|
||||||
}
|
}
|
||||||
item.second.nullifier = boost::none;
|
item.second.nullifier = boost::none;
|
||||||
}
|
}
|
||||||
else if (nd.witnesses.size() > 0) {
|
else {
|
||||||
uint64_t position = nd.witnesses.front().position();
|
uint64_t position = nd.witnesses.front().position();
|
||||||
SaplingFullViewingKey fvk = mapSaplingFullViewingKeys.at(nd.ivk);
|
SaplingFullViewingKey fvk = mapSaplingFullViewingKeys.at(nd.ivk);
|
||||||
OutputDescription output = wtx.vShieldedOutput[op.n];
|
OutputDescription output = wtx.vShieldedOutput[op.n];
|
||||||
|
|||||||
@@ -732,8 +732,8 @@ private:
|
|||||||
|
|
||||||
void AddToTransparentSpends(const COutPoint& outpoint, const uint256& wtxid);
|
void AddToTransparentSpends(const COutPoint& outpoint, const uint256& wtxid);
|
||||||
void AddToSproutSpends(const uint256& nullifier, const uint256& wtxid);
|
void AddToSproutSpends(const uint256& nullifier, const uint256& wtxid);
|
||||||
void AddToSpends(const uint256& wtxid);
|
|
||||||
void AddToSaplingSpends(const uint256& nullifier, const uint256& wtxid);
|
void AddToSaplingSpends(const uint256& nullifier, const uint256& wtxid);
|
||||||
|
void AddToSpends(const uint256& wtxid);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user