Skip to content

Instantly share code, notes, and snippets.

@dexX7
Created April 6, 2015 03:30
Show Gist options
  • Save dexX7/273529eebd07967f484c to your computer and use it in GitHub Desktop.
Save dexX7/273529eebd07967f484c to your computer and use it in GitHub Desktop.
// Not a RPC call at all!
Value HandleTxCreation(const Array& params) {
bool fBroadcast = params.back().get_bool();
// actual implemenation
// ...
}
// RPC call for creation
Value tx_create(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 4 || params.size() > 6)
throw std::runtime_error(
"tx_create ... ... ... ... ..."
);
// push some fillers to blank the default params maybe?
// push broadcasting flag
params.push_back(false);
return HandleTxCreation(params);
}
// RPC call for broadcasting
Value tx_broadcast(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 4 || params.size() > 6)
throw std::runtime_error(
"tx_broadcast ... ... ... ... ..."
);
// push some fillers to blank the default params maybe?
// push broadcasting flag
params.push_back(true);
return HandleTxCreation(params);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment