Rename mapNullifiersToNotes to mapSproutNullifiersToNotes.
This commit is contained in:
parent
618206c7d5
commit
f41bf503e1
|
@ -524,13 +524,13 @@ TEST(wallet_tests, navigate_from_nullifier_to_note) {
|
||||||
|
|
||||||
wtx.SetSproutNoteData(noteData);
|
wtx.SetSproutNoteData(noteData);
|
||||||
|
|
||||||
EXPECT_EQ(0, wallet.mapNullifiersToNotes.count(nullifier));
|
EXPECT_EQ(0, wallet.mapSproutNullifiersToNotes.count(nullifier));
|
||||||
|
|
||||||
wallet.AddToWallet(wtx, true, NULL);
|
wallet.AddToWallet(wtx, true, NULL);
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes.count(nullifier));
|
EXPECT_EQ(1, wallet.mapSproutNullifiersToNotes.count(nullifier));
|
||||||
EXPECT_EQ(wtx.GetHash(), wallet.mapNullifiersToNotes[nullifier].hash);
|
EXPECT_EQ(wtx.GetHash(), wallet.mapSproutNullifiersToNotes[nullifier].hash);
|
||||||
EXPECT_EQ(0, wallet.mapNullifiersToNotes[nullifier].js);
|
EXPECT_EQ(0, wallet.mapSproutNullifiersToNotes[nullifier].js);
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes[nullifier].n);
|
EXPECT_EQ(1, wallet.mapSproutNullifiersToNotes[nullifier].n);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(wallet_tests, spent_note_is_from_me) {
|
TEST(wallet_tests, spent_note_is_from_me) {
|
||||||
|
@ -1046,17 +1046,17 @@ TEST(wallet_tests, UpdateNullifierNoteMap) {
|
||||||
wtx.SetSproutNoteData(noteData);
|
wtx.SetSproutNoteData(noteData);
|
||||||
|
|
||||||
wallet.AddToWallet(wtx, true, NULL);
|
wallet.AddToWallet(wtx, true, NULL);
|
||||||
EXPECT_EQ(0, wallet.mapNullifiersToNotes.count(nullifier));
|
EXPECT_EQ(0, wallet.mapSproutNullifiersToNotes.count(nullifier));
|
||||||
|
|
||||||
EXPECT_FALSE(wallet.UpdateNullifierNoteMap());
|
EXPECT_FALSE(wallet.UpdateNullifierNoteMap());
|
||||||
|
|
||||||
ASSERT_TRUE(wallet.Unlock(vMasterKey));
|
ASSERT_TRUE(wallet.Unlock(vMasterKey));
|
||||||
|
|
||||||
EXPECT_TRUE(wallet.UpdateNullifierNoteMap());
|
EXPECT_TRUE(wallet.UpdateNullifierNoteMap());
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes.count(nullifier));
|
EXPECT_EQ(1, wallet.mapSproutNullifiersToNotes.count(nullifier));
|
||||||
EXPECT_EQ(wtx.GetHash(), wallet.mapNullifiersToNotes[nullifier].hash);
|
EXPECT_EQ(wtx.GetHash(), wallet.mapSproutNullifiersToNotes[nullifier].hash);
|
||||||
EXPECT_EQ(0, wallet.mapNullifiersToNotes[nullifier].js);
|
EXPECT_EQ(0, wallet.mapSproutNullifiersToNotes[nullifier].js);
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes[nullifier].n);
|
EXPECT_EQ(1, wallet.mapSproutNullifiersToNotes[nullifier].n);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(wallet_tests, UpdatedNoteData) {
|
TEST(wallet_tests, UpdatedNoteData) {
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ bool CWallet::UpdateNullifierNoteMap()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update mapNullifiersToNotes with the cached nullifiers in this tx.
|
* Update mapSproutNullifiersToNotes with the cached nullifiers in this tx.
|
||||||
*/
|
*/
|
||||||
void CWallet::UpdateNullifierNoteMapWithTx(const CWalletTx& wtx)
|
void CWallet::UpdateNullifierNoteMapWithTx(const CWalletTx& wtx)
|
||||||
{
|
{
|
||||||
|
@ -1172,7 +1172,7 @@ void CWallet::UpdateNullifierNoteMapWithTx(const CWalletTx& wtx)
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
for (const mapSproutNoteData_t::value_type& item : wtx.mapSproutNoteData) {
|
for (const mapSproutNoteData_t::value_type& item : wtx.mapSproutNoteData) {
|
||||||
if (item.second.nullifier) {
|
if (item.second.nullifier) {
|
||||||
mapNullifiersToNotes[*item.second.nullifier] = item.first;
|
mapSproutNullifiersToNotes[*item.second.nullifier] = item.first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1378,9 +1378,9 @@ void CWallet::MarkAffectedTransactionsDirty(const CTransaction& tx)
|
||||||
}
|
}
|
||||||
for (const JSDescription& jsdesc : tx.vjoinsplit) {
|
for (const JSDescription& jsdesc : tx.vjoinsplit) {
|
||||||
for (const uint256& nullifier : jsdesc.nullifiers) {
|
for (const uint256& nullifier : jsdesc.nullifiers) {
|
||||||
if (mapNullifiersToNotes.count(nullifier) &&
|
if (mapSproutNullifiersToNotes.count(nullifier) &&
|
||||||
mapWallet.count(mapNullifiersToNotes[nullifier].hash)) {
|
mapWallet.count(mapSproutNullifiersToNotes[nullifier].hash)) {
|
||||||
mapWallet[mapNullifiersToNotes[nullifier].hash].MarkDirty();
|
mapWallet[mapSproutNullifiersToNotes[nullifier].hash].MarkDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1478,8 +1478,8 @@ bool CWallet::IsFromMe(const uint256& nullifier) const
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
if (mapNullifiersToNotes.count(nullifier) &&
|
if (mapSproutNullifiersToNotes.count(nullifier) &&
|
||||||
mapWallet.count(mapNullifiersToNotes.at(nullifier).hash)) {
|
mapWallet.count(mapSproutNullifiersToNotes.at(nullifier).hash)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -895,7 +895,7 @@ public:
|
||||||
* - Restarting the node with -reindex (which operates on a locked wallet
|
* - Restarting the node with -reindex (which operates on a locked wallet
|
||||||
* but with the now-cached nullifiers).
|
* but with the now-cached nullifiers).
|
||||||
*/
|
*/
|
||||||
std::map<uint256, JSOutPoint> mapNullifiersToNotes;
|
std::map<uint256, JSOutPoint> mapSproutNullifiersToNotes;
|
||||||
|
|
||||||
std::map<uint256, CWalletTx> mapWallet;
|
std::map<uint256, CWalletTx> mapWallet;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue