diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-03 22:58:40 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-03 22:58:40 +0000 |
commit | 53d508072b02d522371bde148dcc3e925f472be7 (patch) | |
tree | 3220aa303c10ebbcef8520e38a1010f6a7972586 /script.cpp | |
parent | 8be979d9aef606f2a196a2addcf80473d571185b (diff) |
update fSpent flag on wallet transactions if they're seen spent in case copy of wallet.dat was used elsewhere or restored from backup,
better error dialog box if try to spend already spent coins,
got rid of unused notebook with only one tab on main dialog,
nicer looking About dialog,
resize About dialog better on linux
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@55 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'script.cpp')
-rw-r--r-- | script.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/script.cpp b/script.cpp index 0e95af503c..a41de2aa76 100644 --- a/script.cpp +++ b/script.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Satoshi Nakamoto
+// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -1123,5 +1123,13 @@ bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsig if (txin.prevout.hash != txFrom.GetHash())
return false;
- return EvalScript(txin.scriptSig + CScript(OP_CODESEPARATOR) + txout.scriptPubKey, txTo, nIn, nHashType);
+ if (!EvalScript(txin.scriptSig + CScript(OP_CODESEPARATOR) + txout.scriptPubKey, txTo, nIn, nHashType))
+ return false;
+
+ // Anytime a signature is successfully verified, it's proof the outpoint is spent,
+ // so lets update the wallet spent flag if it doesn't know due to wallet.dat being
+ // restored from backup or the user making copies of wallet.dat.
+ WalletUpdateSpent(txin.prevout);
+
+ return true;
}
|