Merge pull request #6354

67ade8005 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 (Lee Clagett)
This commit is contained in:
Alexander Blair 2020-08-09 06:42:48 -07:00
commit c108c5e2f0
No known key found for this signature in database
GPG key ID: C64552D877C32479
9 changed files with 368 additions and 40 deletions

View file

@ -935,7 +935,19 @@ namespace cryptonote
return 1;
}
relay_method tx_relay;
/* If the txes were received over i2p/tor, the default is to "forward"
with a randomized delay to further enhance the "white noise" behavior,
potentially making it harder for ISP-level spies to determine which
inbound link sent the tx. If the sender disabled "white noise" over
i2p/tor, then the sender is "fluffing" (to only outbound) i2p/tor
connections with the `dandelionpp_fluff` flag set. The receiver (hidden
service) will immediately fluff in that scenario (i.e. this assumes that a
sybil spy will be unable to link an IP to an i2p/tor connection). */
const epee::net_utils::zone zone = context.m_remote_address.get_zone();
relay_method tx_relay = zone == epee::net_utils::zone::public_ ?
relay_method::stem : relay_method::forward;
std::vector<blobdata> stem_txs{};
std::vector<blobdata> fluff_txs{};
if (arg.dandelionpp_fluff)
@ -944,10 +956,7 @@ namespace cryptonote
fluff_txs.reserve(arg.txs.size());
}
else
{
tx_relay = relay_method::stem;
stem_txs.reserve(arg.txs.size());
}
for (auto& tx : arg.txs)
{
@ -970,6 +979,7 @@ namespace cryptonote
fluff_txs.push_back(std::move(tx));
break;
default:
case relay_method::forward: // not supposed to happen here
case relay_method::none:
break;
}