mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Use Transaction.getIncludedInBestChainAt()
This commit is contained in:
parent
6c09a671a5
commit
3476765a90
4 changed files with 7 additions and 4 deletions
|
@ -592,6 +592,7 @@ public abstract class WalletService {
|
|||
}
|
||||
|
||||
public List<Transaction> getRecentTransactions(int numTransactions, boolean includeDead) {
|
||||
// Returns a list ordered by tx.getUpdateTime() desc
|
||||
return wallet.getRecentTransactions(numTransactions, includeDead);
|
||||
}
|
||||
|
||||
|
|
|
@ -752,7 +752,8 @@ public abstract class Trade implements Tradable, Model {
|
|||
if (depositTx != null && getTakeOfferDate() != null) {
|
||||
if (depositTx.getConfidence().getDepthInBlocks() > 0) {
|
||||
final long tradeTime = getTakeOfferDate().getTime();
|
||||
long blockTime = depositTx.getUpdateTime().getTime();
|
||||
// Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime()
|
||||
long blockTime = depositTx.getIncludedInBestChainAt() != null ? depositTx.getIncludedInBestChainAt().getTime() : depositTx.getUpdateTime().getTime();
|
||||
// If block date is in future (Date in Bitcoin blocks can be off by +/- 2 hours) we use our current date.
|
||||
// If block date is earlier than our trade date we use our trade date.
|
||||
if (blockTime > now)
|
||||
|
|
|
@ -265,7 +265,8 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
|
|||
bsqWalletService,
|
||||
btcWalletService,
|
||||
daoFacade,
|
||||
transaction.getUpdateTime(),
|
||||
// Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime()
|
||||
transaction.getIncludedInBestChainAt() != null ? transaction.getIncludedInBestChainAt() : transaction.getUpdateTime(),
|
||||
bsqFormatter);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -221,8 +221,8 @@ class TransactionsListItem {
|
|||
else if (details.isEmpty())
|
||||
details = Res.get("funds.tx.txFeePaymentForBsqTx");
|
||||
}
|
||||
|
||||
date = transaction.getUpdateTime();
|
||||
// Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime()
|
||||
date = transaction.getIncludedInBestChainAt() != null ? transaction.getIncludedInBestChainAt() : transaction.getUpdateTime();
|
||||
dateString = formatter.formatDateTime(date);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue