aboutsummaryrefslogtreecommitdiff
path: root/src/script/bitcoinconsensus.h
diff options
context:
space:
mode:
authorThomas Kerin <afk11@users.noreply.github.com>2016-01-24 16:29:39 +0000
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-22 15:43:00 +0200
commitb7dbeb24ebff16198b2925d906c06771e167bd9e (patch)
treea20dd281b3356bd7b74df96480a687aac430f1e3 /src/script/bitcoinconsensus.h
parent2b1f6f9ccf36f1e0a2c9d99154e1642f796d7c2b (diff)
downloadbitcoin-b7dbeb24ebff16198b2925d906c06771e167bd9e.tar.xz
[libconsensus] Script verification API with amounts
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set Rename internal method + make it static trim bitcoinconsensus_ prefix Add SERIALIZE_TRANSACTION_WITNESS flag
Diffstat (limited to 'src/script/bitcoinconsensus.h')
-rw-r--r--src/script/bitcoinconsensus.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/script/bitcoinconsensus.h b/src/script/bitcoinconsensus.h
index cd3e2f7731..6f868d0d6d 100644
--- a/src/script/bitcoinconsensus.h
+++ b/src/script/bitcoinconsensus.h
@@ -33,7 +33,7 @@
extern "C" {
#endif
-#define BITCOINCONSENSUS_API_VER 0
+#define BITCOINCONSENSUS_API_VER 1
typedef enum bitcoinconsensus_error_t
{
@@ -41,6 +41,7 @@ typedef enum bitcoinconsensus_error_t
bitcoinconsensus_ERR_TX_INDEX,
bitcoinconsensus_ERR_TX_SIZE_MISMATCH,
bitcoinconsensus_ERR_TX_DESERIALIZE,
+ bitcoinconsensus_ERR_AMOUNT_REQUIRED,
} bitcoinconsensus_error;
/** Script verification flags */
@@ -50,6 +51,7 @@ enum
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65)
+ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11), // enable WITNESS (BIP141)
};
/// Returns 1 if the input nIn of the serialized transaction pointed to by
@@ -57,6 +59,10 @@ enum
/// the additional constraints specified by flags.
/// If not NULL, err will contain an error/success code for the operation
EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,
+ const unsigned char *txTo , unsigned int txToLen,
+ unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err);
+
+EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount,
const unsigned char *txTo , unsigned int txToLen,
unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err);