builder: Handle `std::ios_base::failure` exceptions during sighash
These can occur if e.g. `PrecomputedTransactionData` encounters an error during parsing of its inputs on the Rust side.
This commit is contained in:
parent
8b68d73802
commit
52e039ebd8
|
@ -640,6 +640,9 @@ TransactionBuilderResult TransactionBuilder::Build()
|
|||
const PrecomputedTransactionData txdata(mtx, tIns);
|
||||
dataToBeSigned = SignatureHash(scriptCode, mtx, NOT_AN_INPUT, SIGHASH_ALL, 0, consensusBranchId, txdata);
|
||||
}
|
||||
} catch (std::ios_base::failure ex) {
|
||||
librustzcash_sapling_proving_ctx_free(ctx);
|
||||
return TransactionBuilderResult("Could not construct signature hash: " + std::string(ex.what()));
|
||||
} catch (std::logic_error ex) {
|
||||
librustzcash_sapling_proving_ctx_free(ctx);
|
||||
return TransactionBuilderResult("Could not construct signature hash: " + std::string(ex.what()));
|
||||
|
|
Loading…
Reference in New Issue