From 98500d70a8cf25af4bab80526fd128ccdc36ceeb Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Fri, 12 Feb 2010 20:38:44 +0000 Subject: command line and JSON-RPC first draft, requires Boost 1.35 or higher for boost::asio, added SetBitcoinAddress and GetBitcoinAddress methods on CScript, critsect interlocks around mapAddressBook, added some random delays in tx broadcast to improve privacy, now compiles with MSVC 8.0 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@60 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- script.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'script.cpp') diff --git a/script.cpp b/script.cpp index a41de2aa7..98f5afd5a 100644 --- a/script.cpp +++ b/script.cpp @@ -660,7 +660,7 @@ bool EvalScript(const CScript& script, const CTransaction& txTo, unsigned int nI if (stack.size() < 1) return false; valtype& vch = stacktop(-1); - valtype vchHash(opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160 ? 20 : 32); + valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); if (opcode == OP_RIPEMD160) RIPEMD160(&vch[0], vch.size(), &vchHash[0]); else if (opcode == OP_SHA1) @@ -753,9 +753,9 @@ bool EvalScript(const CScript& script, const CTransaction& txTo, unsigned int nI CScript scriptCode(pbegincodehash, pend); // Drop the signatures, since there's no way for a signature to sign itself - for (int i = 0; i < nSigsCount; i++) + for (int k = 0; k < nSigsCount; k++) { - valtype& vchSig = stacktop(-isig-i); + valtype& vchSig = stacktop(-isig-k); scriptCode.FindAndDelete(CScript(vchSig)); } @@ -909,7 +909,6 @@ bool CheckSig(vector vchSig, vector vchPubKey, CSc - bool Solver(const CScript& scriptPubKey, vector >& vSolutionRet) { // Templates @@ -919,7 +918,7 @@ bool Solver(const CScript& scriptPubKey, vector >& vSo // Standard tx, sender provides pubkey, receiver adds signature vTemplates.push_back(CScript() << OP_PUBKEY << OP_CHECKSIG); - // Short account number tx, sender provides hash of pubkey, receiver provides signature and pubkey + // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey vTemplates.push_back(CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG); } -- cgit v1.2.3