wait 5 minutes before trigger wire transfer, prevent the exchange to make more than 1 wire transfer if the deposit takes times
This commit is contained in:
parent
06301efda3
commit
8b85fe1775
@ -60,6 +60,7 @@ import {
|
||||
URL,
|
||||
WireFee,
|
||||
TransactionAction,
|
||||
Duration,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
DenominationRecord,
|
||||
@ -1118,6 +1119,9 @@ export async function createDepositGroup(
|
||||
});
|
||||
|
||||
const now = AbsoluteTime.now();
|
||||
const wireDeadline = AbsoluteTime.toProtocolTimestamp(
|
||||
AbsoluteTime.addDuration(now, Duration.fromSpec({ minutes: 5 })),
|
||||
);
|
||||
const nowRounded = AbsoluteTime.toProtocolTimestamp(now);
|
||||
const noncePair = await ws.cryptoApi.createEddsaKeypair({});
|
||||
const merchantPair = await ws.cryptoApi.createEddsaKeypair({});
|
||||
@ -1133,7 +1137,7 @@ export async function createDepositGroup(
|
||||
merchant_base_url: "",
|
||||
summary: "",
|
||||
nonce: noncePair.pub,
|
||||
wire_transfer_deadline: nowRounded,
|
||||
wire_transfer_deadline: wireDeadline,
|
||||
order_id: "",
|
||||
h_wire: wireHash,
|
||||
pay_deadline: AbsoluteTime.toProtocolTimestamp(
|
||||
|
Loading…
Reference in New Issue
Block a user