upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h
index 40f8d45..fde3a4e 100644
--- a/src/main.h
+++ b/src/main.h
@@ -18,6 +18,11 @@ static const unsigned int MAX_SIZE = 0x02000000;
18// Ceiling on transactions held waiting for a parent that has not arrived. 18// Ceiling on transactions held waiting for a parent that has not arrived.
19// They cost a peer nothing to send and are never validated, only stored. 19// They cost a peer nothing to send and are never validated, only stored.
20static const unsigned int MAX_ORPHAN_TRANSACTIONS = 100; 20static const unsigned int MAX_ORPHAN_TRANSACTIONS = 100;
21// Signature operations allowed in one block. Size alone does not bound what a
22// block costs to validate: every OP_CHECKSIG is an elliptic-curve verification,
23// so a block within the size limit could still hold millions of them and take
24// the network minutes of CPU to reject. Same value Bitcoin settled on.
25static const unsigned int MAX_BLOCK_SIGOPS = 20000;
21static const int64 COIN = 100000000; 26static const int64 COIN = 100000000;
22// Total Bitflash emission: identical to Bitcoin (21 million). 27// Total Bitflash emission: identical to Bitcoin (21 million).
23// MAX_MONEY guards against the value overflow bug (CVE-2010-5139), which in 28// MAX_MONEY guards against the value overflow bug (CVE-2010-5139), which in
@@ -503,6 +508,16 @@ public:
503 return (vin.size() == 1 && vin[0].prevout.IsNull()); 508 return (vin.size() == 1 && vin[0].prevout.IsNull());
504 } 509 }
505 510
511 unsigned int GetSigOpCount() const
512 {
513 unsigned int n = 0;
514 foreach(const CTxIn& txin, vin)
515 n += txin.scriptSig.GetSigOpCount();
516 foreach(const CTxOut& txout, vout)
517 n += txout.scriptPubKey.GetSigOpCount();
518 return n;
519 }
520
506 bool CheckTransaction() const 521 bool CheckTransaction() const
507 { 522 {
508 // Basic checks that don't depend on any context 523 // Basic checks that don't depend on any context