improve trezor error message when non witness utxo field is not provided

This commit is contained in:
Craig Raw 2026-05-19 18:14:56 +02:00
parent 45e7a2f97e
commit 2a8c73c131

View File

@ -270,6 +270,9 @@ public class TrezorDevice implements Closeable, ProtocolCallbacks {
private Message sendResponsePrev(Map<Sha256Hash, PrevTx> prevTxs, TrezorMessageBitcoin.TxRequest.RequestType requestType,
TrezorMessageBitcoin.TxRequest.TxRequestDetailsType details) throws DeviceException {
PrevTx prevTx = prevTxs.get(Sha256Hash.wrap(details.getTxHash().toByteArray()));
if(prevTx == null) {
throw new DeviceException("This device requires the full previous transaction for every input, which is omitted from some PSBTs, such as those transferred via QR");
}
if(requestType == TrezorMessageBitcoin.TxRequest.RequestType.TXINPUT) {
TrezorMessageBitcoin.PrevInput prevInput = prevTx.prevInputs().get(details.getRequestIndex());
TrezorMessageBitcoin.TxAckPrevInput txAckPrevInput = TrezorMessageBitcoin.TxAckPrevInput.newBuilder()