mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
Add check to avoid duplicate PSBT_GLOBAL_UNSIGNED_TX
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
a9c296c44b
commit
4019c0b55b
1 changed files with 3 additions and 0 deletions
|
|
@ -1641,6 +1641,9 @@ export function encodePsbt(rawTx: Uint8Array, inputs: PsbtKeyValueMap[], outputs
|
|||
// Add unsigned transaction (key type 0x00)
|
||||
writeKeyValue(PSBT_GLOBAL.UNSIGNED_TX, new Uint8Array(), rawTx);
|
||||
for (const [keyType, items] of globals) {
|
||||
if (keyType === PSBT_GLOBAL.UNSIGNED_TX) {
|
||||
throw new Error('PSBT global map must not include UNSIGNED_TX (0x00); provide it via rawTx');
|
||||
}
|
||||
for (const record of items) {
|
||||
writeKeyValue(keyType, record.keyData, record.value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue