aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-07 13:43:31 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-07 13:43:31 +0000
commita206a23980c15cacf39d267c509bd70c23c94bfa (patch)
tree7a4e29a09bbf32fb9f84abefdd8eb9504195fa32 /main.cpp
parent865c3a23832e36d50cb873d38c976032b027b5d3 (diff)
downloadbitcoin-a206a23980c15cacf39d267c509bd70c23c94bfa.tar.xz
IsStandard() check for CScripts: only relay/include in blocks CScripts we can understand.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@197 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index be29ceb971..10d482d898 100644
--- a/main.cpp
+++ b/main.cpp
@@ -572,7 +572,7 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
return error("AcceptToMemoryPool() : not accepting nLockTime beyond 2038 yet");
// Rather not work on nonstandard transactions
- if (GetSigOpCount() > 2 || ::GetSerializeSize(*this, SER_NETWORK) < 100)
+ if (!IsStandard() || GetSigOpCount() > 2 || ::GetSerializeSize(*this, SER_NETWORK) < 100)
return error("AcceptToMemoryPool() : nonstandard transaction");
// Do we already have it?
@@ -2567,15 +2567,17 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
else if (strCommand == "checkorder")
{
uint256 hashReply;
- CWalletTx order;
- vRecv >> hashReply >> order;
+ vRecv >> hashReply;
- if (!mapArgs.count("-allowreceivebyip") || mapArgs["-allowreceivebyip"] == "0")
+ if (!GetBoolArg("-allowreceivebyip"))
{
pfrom->PushMessage("reply", hashReply, (int)2, string(""));
return true;
}
+ CWalletTx order;
+ vRecv >> order;
+
/// we have a chance to check the order here
// Keep giving the same key to the same ip until they use it
@@ -2592,16 +2594,18 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
else if (strCommand == "submitorder")
{
uint256 hashReply;
- CWalletTx wtxNew;
- vRecv >> hashReply >> wtxNew;
- wtxNew.fFromMe = false;
+ vRecv >> hashReply;
- if (!mapArgs.count("-allowreceivebyip") || mapArgs["-allowreceivebyip"] == "0")
+ if (!GetBoolArg("-allowreceivebyip"))
{
pfrom->PushMessage("reply", hashReply, (int)2);
return true;
}
+ CWalletTx wtxNew;
+ vRecv >> wtxNew;
+ wtxNew.fFromMe = false;
+
// Broadcast
if (!wtxNew.AcceptWalletTransaction())
{