Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 20f765f

Browse files
authored
VG-9732 Avoid 503 error on explorer /timestamp (#932)
* VG-9732 Avoid 503 error on explorer /timestamp
1 parent 4d48c99 commit 20f765f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

core/src/wallet/bitcoin/transaction_builders/BitcoinLikeUtxoPicker.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,13 @@ namespace ledger {
155155
return Future<Unit>::successful(unit);
156156
}
157157
// Set timestamp
158-
buddy->explorer->getTimestamp().onComplete(getContext(), [=](const Try<int64_t> &timestamp) {
159-
if (timestamp.isSuccess()) {
160-
buddy->transaction->setTimestamp(timestamp.getValue());
161-
}
162-
});
163-
158+
if (_currency.bitcoinLikeNetworkParameters->UsesTimestampedTransaction) {
159+
buddy->explorer->getTimestamp().onComplete(getContext(), [=](const Try<int64_t> &timestamp) {
160+
if (timestamp.isSuccess()) {
161+
buddy->transaction->setTimestamp(timestamp.getValue());
162+
}
163+
});
164+
}
164165
return buddy->explorer->getCurrentBlock().map<Unit>(getContext(), [=](const std::shared_ptr<BitcoinLikeBlockchainExplorer::Block> &block) -> Unit {
165166
buddy->transaction->setLockTime(static_cast<uint32_t>(block->height));
166167
return unit;

0 commit comments

Comments
 (0)