From 28d090c05ea324444184a1e03b3f29151894782e Mon Sep 17 00:00:00 2001 From: dimxy Date: Tue, 22 Jan 2019 20:02:20 +0500 Subject: [PATCH] corr adding marker vout for F --- src/cc/heir.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index a5533c0c1..993c7bb5b 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -678,7 +678,7 @@ template UniValue _HeirFund(int64_t txfee, int64_t amount, std cpHeir = CCinit(&heirC, EVAL_HEIR); CPubKey heirUnspendablePubKey = GetUnspendable(cpHeir, 0); // mtx.vout.push_back(CTxOut(txfee, CScript() << ParseHex(HexStr(heirUnspendablePubKey)) << OP_CHECKSIG)); <-- bad marker cause it was spendable by anyone - MakeCC1vout(EVAL_HEIR, txfee, heirUnspendablePubKey); // this marker spending is disabled in the validation code + mtx.vout.push_back(MakeCC1vout(EVAL_HEIR, markerfee, heirUnspendablePubKey)); // this marker spending is disabled in the validation code // calc and add change vout: if (inputs > amount) @@ -762,6 +762,8 @@ template UniValue _HeirAdd(uint256 fundingtxid, int64_t txfee, in if (txfee == 0) txfee = 10000; + int64_t markerfee = 10000; + CPubKey myPubkey = pubkey2pk(Mypubkey()); // check if it is the owner @@ -771,7 +773,7 @@ template UniValue _HeirAdd(uint256 fundingtxid, int64_t txfee, in return result; } - if (AddNormalinputs(mtx, myPubkey, txfee, 3) > 0) { // txfee for miners + if (AddNormalinputs(mtx, myPubkey, markerfee, 3) > 0) { // some for marker int64_t inputs, change; @@ -789,7 +791,7 @@ template UniValue _HeirAdd(uint256 fundingtxid, int64_t txfee, in char markeraddr[64]; CPubKey markerPubkey = CCtxidaddr(markeraddr, fundingtxid); - mtx.vout.push_back(CTxOut(txfee, CScript() << ParseHex(HexStr(markerPubkey)) << OP_CHECKSIG)); // marker to prevent archiving of the funds add vouts + mtx.vout.push_back(CTxOut(markerfee, CScript() << ParseHex(HexStr(markerPubkey)) << OP_CHECKSIG)); // marker to prevent archiving of the funds add vouts if (inputs > amount) change = (inputs - amount); // -txfee <-- txfee pays user