Skip to content

Commit

Permalink
Chill out on the logspam
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Jun 18, 2020
1 parent 9bcf13b commit a7cd2b3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1719,22 +1719,24 @@ void CWallet::GetSaplingNoteWitnesses(std::vector<SaplingOutPoint> notes,
boost::optional<uint256> rt;
int i = 0;
for (SaplingOutPoint note : notes) {
fprintf(stderr,"%s: i=%d\n", __func__,i);
//fprintf(stderr,"%s: i=%d\n", __func__,i);
auto noteData = mapWallet[note.hash].mapSaplingNoteData;
auto nWitnesses = noteData[note].witnesses.size();
if (mapWallet.count(note.hash) && noteData.count(note) && nWitnesses > 0) {
fprintf(stderr,"%s: Found %lu witnesses for note %s\n", __func__, nWitnesses, note.hash.ToString().c_str() );
witnesses[i] = noteData[note].witnesses.front();
if (!rt) {
fprintf(stderr,"%s: Setting witness root\n",__func__);
//fprintf(stderr,"%s: Setting witness root\n",__func__);
rt = witnesses[i]->root();
} else {
if(*rt == witnesses[i]->root()) {
//fprintf(stderr,"%s: rt=%s\n",__func__,rt.GetHash().ToString().c_str());
//fprintf(stderr,"%s: witnesses[%d]->root()=%s\n",__func__,i,witnesses[i]->root().GetHash().ToString().c_str());
// Something is fucky
std::string err = std::string("CWallet::GetSaplingNoteWitnesses: Invalid witness root! rt=") + rt.get().ToString();
throw std::logic_error(err);
std::string err = string("CWallet::GetSaplingNoteWitnesses: Invalid witness root! rt=") + rt.get().ToString();
err += string("\n!= witness[i]->root()=") + witnesses[i]->root().ToString();
//throw std::logic_error(err);
fprintf(stderr,"%s: IGNORING %s\n", __func__,err.c_str());
}

}
Expand All @@ -1744,6 +1746,7 @@ void CWallet::GetSaplingNoteWitnesses(std::vector<SaplingOutPoint> notes,
// All returned witnesses have the same anchor
if (rt) {
final_anchor = *rt;
//fprintf(stderr,"%s: final_anchor=%s\n", __func__, rt.get().ToString().c_str() );
}
}

Expand Down

0 comments on commit a7cd2b3

Please sign in to comment.