1111#include < script/signingprovider.h>
1212#include < script/standard.h>
1313#include < uint256.h>
14+ #include < util/translation.h>
1415#include < util/vector.h>
1516
1617typedef std::vector<unsigned char > valtype;
@@ -626,7 +627,7 @@ bool IsSegWitOutput(const SigningProvider& provider, const CScript& script)
626627 return false ;
627628}
628629
629- bool SignTransaction (CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, int nHashType, std::map<int , std::string >& input_errors)
630+ bool SignTransaction (CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, int nHashType, std::map<int , bilingual_str >& input_errors)
630631{
631632 bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE);
632633
@@ -658,7 +659,7 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
658659 CTxIn& txin = mtx.vin [i];
659660 auto coin = coins.find (txin.prevout );
660661 if (coin == coins.end () || coin->second .IsSpent ()) {
661- input_errors[i] = " Input not found or already spent" ;
662+ input_errors[i] = _ ( " Input not found or already spent" ) ;
662663 continue ;
663664 }
664665 const CScript& prevPubKey = coin->second .out .scriptPubKey ;
@@ -674,20 +675,20 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
674675
675676 // amount must be specified for valid segwit signature
676677 if (amount == MAX_MONEY && !txin.scriptWitness .IsNull ()) {
677- input_errors[i] = " Missing amount" ;
678+ input_errors[i] = _ ( " Missing amount" ) ;
678679 continue ;
679680 }
680681
681682 ScriptError serror = SCRIPT_ERR_OK;
682683 if (!VerifyScript (txin.scriptSig , prevPubKey, &txin.scriptWitness , STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker (&txConst, i, amount, txdata, MissingDataBehavior::FAIL), &serror)) {
683684 if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
684685 // Unable to sign input and verification failed (possible attempt to partially sign).
685- input_errors[i] = " Unable to sign input, invalid stack size (possibly missing key)" ;
686+ input_errors[i] = Untranslated ( " Unable to sign input, invalid stack size (possibly missing key)" ) ;
686687 } else if (serror == SCRIPT_ERR_SIG_NULLFAIL) {
687688 // Verification failed (possibly due to insufficient signatures).
688- input_errors[i] = " CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)" ;
689+ input_errors[i] = Untranslated ( " CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)" ) ;
689690 } else {
690- input_errors[i] = ScriptErrorString (serror);
691+ input_errors[i] = Untranslated ( ScriptErrorString (serror) );
691692 }
692693 } else {
693694 // If this input succeeds, make sure there is no error set for it
0 commit comments