From da6960ddb739e2c8f42a3802b73a6b9b318a5384 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Sat, 21 Oct 2017 16:32:04 +0200 Subject: [PATCH] validation variables changed to not assume witness program for pegin --- src/validation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 6e4008a6e3..93f69ae3bf 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2294,8 +2294,8 @@ bool BitcoindRPCCheck(const bool init) return true; } -/* Takes federation redeeem script and adds HMAC_SHA256(pubkey, witnessProgram) as a tweak to each pubkey */ -CScript calculate_contract(const CScript& federationRedeemScript, const CScript& witnessProgram) { +/* Takes federation redeeem script and adds HMAC_SHA256(pubkey, scriptPubKey) as a tweak to each pubkey */ +CScript calculate_contract(const CScript& federationRedeemScript, const CScript& scriptPubKey) { CScript scriptDestination(federationRedeemScript); txnouttype type; std::vector > solutions; @@ -2317,7 +2317,7 @@ CScript calculate_contract(const CScript& federationRedeemScript, const CScript& size_t pub_len = 33; int ret; unsigned char *pub_start = &(*(sdpc - pub_len)); - CHMAC_SHA256(pub_start, pub_len).Write(witnessProgram.data(), witnessProgram.size()).Finalize(tweak); + CHMAC_SHA256(pub_start, pub_len).Write(scriptPubKey.data(), scriptPubKey.size()).Finalize(tweak); secp256k1_pubkey watchman; secp256k1_pubkey tweaked; ret = secp256k1_ec_pubkey_parse(secp256k1_ctx_verify_amounts, &watchman, pub_start, pub_len);