Skip to content

Commit

Permalink
Merge pull request bitcoin#317
Browse files Browse the repository at this point in the history
b4c9e89 Expose feature activation fields when decoding transaction (dexX7)
  • Loading branch information
dexX7 committed Dec 31, 2015
2 parents cf1ffb7 + b4c9e89 commit 4fcd4ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/omnicore/rpctxobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ void populateRPCTypeInfo(CMPTransaction& mp_obj, Object& txobj, uint32_t txType,
case MSC_TYPE_CHANGE_ISSUER_ADDRESS:
populateRPCTypeChangeIssuer(mp_obj, txobj);
break;
case OMNICORE_MESSAGE_TYPE_ACTIVATION:
populateRPCTypeActivation(mp_obj, txobj);
break;
}
}

Expand All @@ -221,6 +224,7 @@ bool showRefForTx(uint32_t txType)
case MSC_TYPE_REVOKE_PROPERTY_TOKENS: return false;
case MSC_TYPE_CHANGE_ISSUER_ADDRESS: return true;
case MSC_TYPE_SEND_ALL: return true;
case OMNICORE_MESSAGE_TYPE_ACTIVATION: return false;
}
return true; // default to true, shouldn't be needed but just in case
}
Expand Down Expand Up @@ -478,6 +482,13 @@ void populateRPCTypeChangeIssuer(CMPTransaction& omniObj, Object& txobj)
txobj.push_back(Pair("divisible", isPropertyDivisible(propertyId)));
}

void populateRPCTypeActivation(CMPTransaction& omniObj, Object& txobj)
{
txobj.push_back(Pair("featureid", (uint64_t) omniObj.getFeatureId()));
txobj.push_back(Pair("activationblock", (uint64_t) omniObj.getActivationBlock()));
txobj.push_back(Pair("minimumversion", (uint64_t) omniObj.getMinClientVersion()));
}

void populateRPCExtendedTypeSendToOwners(const uint256 txid, std::string extendedDetailsFilter, Object& txobj)
{
Array receiveArray;
Expand Down
1 change: 1 addition & 0 deletions src/omnicore/rpctxobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void populateRPCTypeCloseCrowdsale(CMPTransaction& omniObj, json_spirit::Object&
void populateRPCTypeGrant(CMPTransaction& omniObj, json_spirit::Object& txobj);
void populateRPCTypeRevoke(CMPTransaction& omniOobj, json_spirit::Object& txobj);
void populateRPCTypeChangeIssuer(CMPTransaction& omniObj, json_spirit::Object& txobj);
void populateRPCTypeActivation(CMPTransaction& omniObj, json_spirit::Object& txobj);

void populateRPCExtendedTypeSendToOwners(const uint256 txid, std::string extendedDetailsFilter, json_spirit::Object& txobj);
void populateRPCExtendedTypeMetaDExTrade(const uint256& txid, uint32_t propertyIdForSale, int64_t amountForSale, json_spirit::Object& txobj);
Expand Down
3 changes: 3 additions & 0 deletions src/omnicore/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ class CMPTransaction
uint32_t getAlertExpiry() const { return alert_expiry; }
std::string getAlertMessage() const { return alert_text; }
int getPayloadSize() const { return pkt_size; }
uint16_t getFeatureId() const { return feature_id; }
uint32_t getActivationBlock() const { return activation_block; }
uint32_t getMinClientVersion() const { return min_client_version; }

/** Creates a new CMPTransaction object. */
CMPTransaction()
Expand Down

0 comments on commit 4fcd4ed

Please sign in to comment.