aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-02-11 19:24:14 -0500
committerAndrew Chow <achow101-github@achow101.com>2020-03-09 11:16:20 -0400
commitd2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf (patch)
tree219d788dcd228bb6993def93e6b8e89890773327 /src/script
parentdc174881ad8498a6905ba282a48077bc5c8037a7 (diff)
downloadbitcoin-d2774c09cfcc6c5c967d40bb094eabc8c0bdb6bf.tar.xz
Clear any input_errors for an input after it is signed
Make sure that there are no errors set for an input after it is signed. This is useful for when there are multiple ScriptPubKeyMans. Some may fail to sign, but one may be able to sign, and after it does, we don't want there to be any more errors there.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/sign.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index a8abd347da..fe8292fe57 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -509,6 +509,9 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
} else {
input_errors[i] = ScriptErrorString(serror);
}
+ } else {
+ // If this input succeeds, make sure there is no error set for it
+ input_errors.erase(i);
}
}
return input_errors.empty();