mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge b1a672d158 into merged_master (Bitcoin PR bitcoin/bitcoin#22337)
This commit is contained in:
commit
a20c67310c
17 changed files with 92 additions and 80 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <script/signingprovider.h>
|
||||
#include <script/standard.h>
|
||||
#include <uint256.h>
|
||||
#include <util/translation.h>
|
||||
#include <util/vector.h>
|
||||
|
||||
#include <chainparams.h>
|
||||
|
|
@ -653,7 +654,7 @@ bool IsSegWitOutput(const SigningProvider& provider, const CScript& script)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, int nHashType, const uint256& hash_genesis_block, std::map<int, std::string>& input_errors)
|
||||
bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, int nHashType, const uint256& hash_genesis_block, std::map<int, bilingual_str>& input_errors)
|
||||
{
|
||||
bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE);
|
||||
|
||||
|
|
@ -692,7 +693,7 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
|
|||
} else {
|
||||
auto coin = coins.find(txin.prevout);
|
||||
if (coin == coins.end() || coin->second.IsSpent()) {
|
||||
input_errors[i] = "Input not found or already spent";
|
||||
input_errors[i] = _("Input not found or already spent");
|
||||
continue;
|
||||
}
|
||||
prevTxOut = coin->second.out;
|
||||
|
|
@ -711,7 +712,7 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
|
|||
|
||||
// amount must be specified for valid segwit signature
|
||||
if (amount.IsExplicit() && amount.GetAmount() == MAX_MONEY && !mtx.witness.vtxinwit[i].scriptWitness.IsNull()) {
|
||||
input_errors[i] = "Missing amount";
|
||||
input_errors[i] = _("Missing amount");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -719,12 +720,12 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
|
|||
if (!VerifyScript(txin.scriptSig, prevPubKey, &inWitness.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount, txdata, MissingDataBehavior::FAIL), &serror)) {
|
||||
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
|
||||
// Unable to sign input and verification failed (possible attempt to partially sign).
|
||||
input_errors[i] = "Unable to sign input, invalid stack size (possibly missing key)";
|
||||
input_errors[i] = Untranslated("Unable to sign input, invalid stack size (possibly missing key)");
|
||||
} else if (serror == SCRIPT_ERR_SIG_NULLFAIL) {
|
||||
// Verification failed (possibly due to insufficient signatures).
|
||||
input_errors[i] = "CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)";
|
||||
input_errors[i] = Untranslated("CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)");
|
||||
} else {
|
||||
input_errors[i] = ScriptErrorString(serror);
|
||||
input_errors[i] = Untranslated(ScriptErrorString(serror));
|
||||
}
|
||||
} else {
|
||||
// If this input succeeds, make sure there is no error set for it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue