Switch to Dandelion++ fluff mode if no out connections for stem mode

This commit is contained in:
Lee Clagett 2020-11-03 13:58:14 -05:00
parent 76cc82c292
commit 58cde83fb0
2 changed files with 113 additions and 6 deletions

View file

@ -524,12 +524,7 @@ namespace levin
if (!zone_ || !core_ || txs_.empty())
return;
if (zone_->fluffing)
{
core_->on_transactions_relayed(epee::to_span(txs_), relay_method::fluff);
fluff_notify::run(std::move(zone_), epee::to_span(txs_), source_);
}
else // forward tx in stem
if (!zone_->fluffing)
{
core_->on_transactions_relayed(epee::to_span(txs_), relay_method::stem);
for (int tries = 2; 0 < tries; tries--)
@ -549,6 +544,9 @@ namespace levin
MERROR("Unable to send transaction(s) via Dandelion++ stem");
}
core_->on_transactions_relayed(epee::to_span(txs_), relay_method::fluff);
fluff_notify::run(std::move(zone_), epee::to_span(txs_), source_);
}
};