Revert "Use dynamically generated zaddrs in sietch, which are not stored in wallet.dat"

This reverts commit 89532c4d7b.
This commit is contained in:
Duke Leto
2020-07-23 22:53:12 -04:00
parent cf83dc135a
commit 7e0c41977f
2 changed files with 223 additions and 17 deletions

View File

@@ -4749,29 +4749,30 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
// OK, we identify this xtn as needing privacy zdust, we must decide how much, non-deterministically
int nAmount = 0;
int decider = 1 + GetRandInt(100); // random int between 1 and 100
string memo = "f600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
string zdust1, zdust2;
// Which zaddr we send to is dynamically generated
zdust1 = newSietchZaddr();
// Which zaddr we send to is non-deterministically chosen from two zpools...
zdust1 = randomSietchZaddr();
// And their ordering when given to internals is also non-deterministic, which
// helps breaks assumptions blockchain analysts may use from z_sendmany internals
if (decider % 2) {
zaddrRecipients.insert(std::begin(zaddrRecipients), newSietchRecipient(zdust1) );
zaddrRecipients.insert(std::begin(zaddrRecipients), SendManyRecipient(zdust1, nAmount, memo) );
} else {
zaddrRecipients.push_back( newSietchRecipient(zdust1) );
zaddrRecipients.push_back( SendManyRecipient(zdust1, nAmount, memo) );
}
if(fZdebug)
fprintf(stderr,"%s: adding %s as zdust receiver\n", __FUNCTION__, zdust1.c_str());
//50% chance of adding another zout
if (decider % 2) {
zdust2 = newSietchZaddr();
zdust2 = randomSietchZaddr();
if(decider % 4 == 3) {
zaddrRecipients.push_back( newSietchRecipient(zdust2) );
zaddrRecipients.push_back( SendManyRecipient(zdust2, nAmount, memo) );
} else {
zaddrRecipients.insert(std::begin(zaddrRecipients), newSietchRecipient(zdust2) );
zaddrRecipients.insert(std::begin(zaddrRecipients), SendManyRecipient(zdust2, nAmount, memo) );
}
if(fZdebug)
fprintf(stderr,"%s: adding %s as zdust receiver\n", __FUNCTION__, zdust2.c_str());