Skip to content

Commit 2b49957

Browse files
committed
fix: don't populate a default request id
1 parent 0882f0b commit 2b49957

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/controllers/transactions.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { pushTransaction } from "../krist/transactions/create.js";
4141
import { getTransaction, getTransactions, getTransactionsByAddress } from "../krist/transactions/index.js";
4242
import { isValidKristAddress, METANAME_METADATA_RE, NAME_META_RE, REQUEST_ID_RE, validateLimitOffset } from "../utils/index.js";
4343
import { checkTxRateLimits } from "../utils/rateLimit.js";
44-
import { v4 as uuidv4 } from "uuid";
4544

4645
export async function ctrlGetTransactions(
4746
limit: Limit,
@@ -95,7 +94,6 @@ export async function ctrlMakeTransaction(
9594
rawAmount?: string | number,
9695
metadata?: string,
9796
requestId?: string
98-
9997
): Promise<Transaction> {
10098
if (!await areTransactionsEnabled()) throw new ErrorTransactionsDisabled();
10199

@@ -104,8 +102,7 @@ export async function ctrlMakeTransaction(
104102
if (!recipient) throw new ErrorMissingParameter("to");
105103
if (!rawAmount) throw new ErrorMissingParameter("amount");
106104

107-
if (!requestId) requestId = uuidv4();
108-
if (!REQUEST_ID_RE.test(requestId))
105+
if (requestId && !REQUEST_ID_RE.test(requestId))
109106
throw new ErrorInvalidParameter("requestId");
110107

111108
// Check if we're paying to a name

0 commit comments

Comments
 (0)