From f86b32e80d2690d0eeea45a3ef2a74b4adbba403 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Tue, 28 Feb 2017 15:42:39 -0800 Subject: [PATCH] getrawtransaction: scriptpubkey type is 'fee' --- src/rpc/rawtransaction.cpp | 5 +---- src/script/standard.cpp | 8 +++++++- src/script/standard.h | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 4a749542d8..ec9793a6e3 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -129,10 +129,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) const CTxOut& txout = tx.vout[i]; UniValue out(UniValue::VOBJ); if (txout.nValue.IsAmount()) - if (txout.IsFee()) - out.push_back(Pair("fee_value", ValueFromAmount(txout.nValue.GetAmount()))); - else - out.push_back(Pair("value", ValueFromAmount(txout.nValue.GetAmount()))); + out.push_back(Pair("value", ValueFromAmount(txout.nValue.GetAmount()))); else { int exp; int mantissa; diff --git a/src/script/standard.cpp b/src/script/standard.cpp index cb5b443252..1a0954c04b 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -35,6 +35,7 @@ const char* GetTxnOutputType(txnouttype t) case TX_WITNESS_V0_SCRIPTHASH: return "witness_v0_scripthash"; case TX_WITHDRAW_LOCK: return "withdraw"; case TX_TRUE: return "true"; + case TX_FEE: return "fee"; } return NULL; } @@ -70,6 +71,11 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector witnessprogram; if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { @@ -229,7 +235,7 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto vector vSolutions; if (!Solver(scriptPubKey, typeRet, vSolutions)) return false; - if (typeRet == TX_NULL_DATA || typeRet == TX_WITHDRAW_LOCK){ + if (typeRet == TX_NULL_DATA || typeRet == TX_WITHDRAW_LOCK || typeRet == TX_FEE){ // This is data, not addresses return false; } diff --git a/src/script/standard.h b/src/script/standard.h index f352d08061..c7a07c7236 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -55,6 +55,7 @@ enum txnouttype TX_WITNESS_V0_KEYHASH, TX_WITHDRAW_LOCK, TX_TRUE, + TX_FEE, }; class CNoDestination {