From aafb8d22995e675fb9a2f2ff0450716f1491da35 Mon Sep 17 00:00:00 2001 From: Kukks Date: Mon, 20 Apr 2020 13:16:43 +0200 Subject: [PATCH] conflict fix --- .gitignore | 1 + ts_src/index.ts | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 0972d12..b65dcd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules coverage package-lock.json +.idea diff --git a/ts_src/index.ts b/ts_src/index.ts index 2e0717f..43db4e7 100644 --- a/ts_src/index.ts +++ b/ts_src/index.ts @@ -34,12 +34,6 @@ export async function requestPayjoinWithCustomRemoteCall( const payjoinPsbt = await remoteCall(clonedPsbt); if (!payjoinPsbt) throw new Error("We did not get the receiver's PSBT"); - // no inputs were added? - if (clonedPsbt.inputCount <= payjoinPsbt.inputCount) { - throw new Error( - "There were less inputs than before in the receiver's PSBT", - ); - } if ( payjoinPsbt.data.globalMap.globalXpub && @@ -93,8 +87,13 @@ export async function requestPayjoinWithCustomRemoteCall( payjoinPsbt.updateOutput(index, originalOutput); }); } - // TODO: check payjoinPsbt.version == psbt.version - // TODO: check payjoinPsbt.locktime == psbt.locktime + + if (getGlobalTransaction(payjoinPsbt).version !== getGlobalTransaction(psbt).version) { + throw new Error('The version field of the transaction has been modified'); + } + if (getGlobalTransaction(payjoinPsbt).locktime !== getGlobalTransaction(psbt).locktime) { + throw new Error('The LockTime field of the transaction has been modified'); + } // TODO: check payjoinPsbt.inputs where input belongs to us, that it is not finalized // TODO: check payjoinPsbt.inputs where input belongs to us, that it is was included in psbt.inputs // TODO: check payjoinPsbt.inputs where input belongs to us, that its sequence has not changed from that of psbt.inputs