From 0c2c564c249d6333d36dc27a203aac7025e0a497 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 21 Sep 2018 23:29:00 -1100 Subject: [PATCH] ac_private to allow notary p2pk bouts --- src/komodo_notary.h | 15 +++++++++++++++ src/main.cpp | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 4711a9afc..b619c5b29 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -198,6 +198,21 @@ const char *Notaries_elected1[][2] = {"xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, }; +int32_t komodo_isnotaryvout(CScript scriptPubKey) // from ac_private chains only +{ + uint8_t pubkey33[33],*ptr = scriptPubKey.data(); int32_t i; + if ( scriptPubKey.size() == 35 && ptr[0] == 33 && ptr[34] == 0xac ) + { + for (i=0; i 0 && iscoinbase == 0) || tx.GetJoinSplitValueOut() > 0 ) - return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain"); + { + if ( komodo_isnotaryvout(txout.scriptPubKey) == 0 ) + return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain"); + } } if ( txout.scriptPubKey.size() > IGUANA_MAXSCRIPTSIZE ) return state.DoS(100, error("CheckTransaction(): txout.scriptPubKey.size() too big"),REJECT_INVALID, "bad-txns-vout-negative");