mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Republish trade statistics from seller side if peer capability is know. This is not the case without getting PR #4609 merges as well.
We only do it for 2 weeks after planned release time as then it can be assumed that enough nodes have updated that the normal publishing will distribute the object sufficiently.
This commit is contained in:
parent
197d8c1e0d
commit
18a27e9067
@ -39,12 +39,17 @@ import bisq.network.p2p.NodeAddress;
|
||||
|
||||
import bisq.common.handlers.ErrorMessageHandler;
|
||||
import bisq.common.handlers.ResultHandler;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public abstract class SellerProtocol extends DisputeProtocol {
|
||||
enum SellerEvent implements FluentProtocol.Event {
|
||||
STARTUP,
|
||||
PAYMENT_RECEIVED
|
||||
}
|
||||
|
||||
@ -52,6 +57,27 @@ public abstract class SellerProtocol extends DisputeProtocol {
|
||||
super(trade);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitialized() {
|
||||
super.onInitialized();
|
||||
|
||||
// We get called the constructor with any possible state and phase. As we don't want to log an error for such
|
||||
// cases we use the alternative 'given' method instead of 'expect'.
|
||||
|
||||
// We only re-publish for about 2 weeks after 1.4.0 release until most nodes have updated to
|
||||
// achieve sufficient resilience.
|
||||
boolean currentDateBeforeCutOffDate = new Date().before(Utilities.getUTCDate(2020, GregorianCalendar.NOVEMBER, 1));
|
||||
given(anyPhase(Trade.Phase.DEPOSIT_PUBLISHED,
|
||||
Trade.Phase.DEPOSIT_CONFIRMED,
|
||||
Trade.Phase.FIAT_SENT,
|
||||
Trade.Phase.FIAT_RECEIVED,
|
||||
Trade.Phase.PAYOUT_PUBLISHED)
|
||||
.with(SellerEvent.STARTUP)
|
||||
.preCondition(currentDateBeforeCutOffDate))
|
||||
.setup(tasks(SellerPublishesTradeStatistics.class))
|
||||
.executeTasks();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Mailbox
|
||||
|
Loading…
Reference in New Issue
Block a user