mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,4 +25,4 @@ node_modules
|
||||
tmp
|
||||
|
||||
# Ignore database directory.
|
||||
db/*.db
|
||||
db/*.db
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
// instances of this class for network access.
|
||||
//
|
||||
|
||||
// Node
|
||||
var util = require('util');
|
||||
|
||||
// npm
|
||||
var WebSocket = require('ws');
|
||||
|
||||
@@ -317,7 +314,7 @@ Remote.prototype._connect_start = function () {
|
||||
// with self-signed certs as the user must have pre-approved the self-signed certs.
|
||||
|
||||
var self = this;
|
||||
var url = util.format("ws://%s:%s", this.websocket_ip, this.websocket_port);
|
||||
var url = "ws://" + this.websocket_ip + ":" + this.websocket_port;
|
||||
|
||||
if (this.trace) console.log("remote: connect: %s", url);
|
||||
|
||||
|
||||
@@ -892,8 +892,16 @@ STAmount STAmount::multiply(const STAmount& v1, const STAmount& v2, const uint16
|
||||
if (v1.isZero() || v2.isZero())
|
||||
return STAmount(uCurrencyID, uIssuerID);
|
||||
|
||||
if (v1.mIsNative && v2.mIsNative) // FIXME: overflow
|
||||
return STAmount(v1.getFName(), v1.getSNValue() * v2.getSNValue());
|
||||
if (v1.mIsNative && v2.mIsNative)
|
||||
{
|
||||
uint64 minV = (v1.getSNValue() < v2.getSNValue()) ? v1.getSNValue() : v2.getSNValue();
|
||||
uint64 maxV = (v1.getSNValue() < v2.getSNValue()) ? v2.getSNValue() : v1.getSNValue();
|
||||
if (minV > 3000000000) // sqrt(cMaxNative)
|
||||
throw std::runtime_error("Native value overflow");
|
||||
if (((maxV >> 32) * minV) > 2095475792) // cMaxNative / 2^32
|
||||
throw std::runtime_error("Native value overflow");
|
||||
return STAmount(v1.getFName(), minV * maxV);
|
||||
}
|
||||
|
||||
uint64 value1 = v1.mValue, value2 = v2.mValue;
|
||||
int offset1 = v1.mOffset, offset2 = v2.mOffset;
|
||||
|
||||
@@ -906,6 +906,23 @@ Json::Value NetworkOPs::getServerInfo()
|
||||
if (mConsensus)
|
||||
info["consensus"] = mConsensus->getJson();
|
||||
|
||||
typedef std::pair<JobType, int> jt_int_pair;
|
||||
bool anyJobs = false;
|
||||
Json::Value jobs = Json::arrayValue;
|
||||
std::vector< std::pair<JobType, int> > jobCounts = theApp->getJobQueue().getJobCounts();
|
||||
BOOST_FOREACH(jt_int_pair& it, jobCounts)
|
||||
{
|
||||
if (it.second != 0)
|
||||
{
|
||||
Json::Value o = Json::objectValue;
|
||||
o[Job::toString(it.first)] = it.second;
|
||||
jobs.append(o);
|
||||
anyJobs = true;
|
||||
}
|
||||
}
|
||||
if (anyJobs)
|
||||
info["jobs"] = jobs;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ protected:
|
||||
|
||||
public:
|
||||
SHAMapMissingNode(SHAMapType t, const SHAMapNode& nodeID, const uint256& nodeHash) :
|
||||
std::runtime_error(nodeID.getString()), mType(t), mNodeID(nodeID), mNodeHash(nodeHash)
|
||||
std::runtime_error("SHAMapMissingNode"), mType(t), mNodeID(nodeID), mNodeHash(nodeHash)
|
||||
{ ; }
|
||||
|
||||
SHAMapMissingNode(SHAMapType t, const SHAMapNode& nodeID, const uint256& nodeHash, const uint256& targetIndex) :
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
|
||||
std::string SHAMapNode::getString() const
|
||||
{
|
||||
static boost::format NodeID("NodeID(%s,%s)");
|
||||
|
||||
if ((mDepth == 0) && (mNodeID.isZero()))
|
||||
return "NodeID(root)";
|
||||
|
||||
return str(boost::format("NodeID(%s,%s)")
|
||||
return str(NodeID
|
||||
% boost::lexical_cast<std::string>(mDepth)
|
||||
% mNodeID.GetHex());
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ bool TransactionMaster::canonicalize(Transaction::pointer& txn, bool may_be_new)
|
||||
uint256 tid = txn->getID();
|
||||
if (!tid) return false;
|
||||
if (mCache.canonicalize(tid, txn)) return true;
|
||||
if (may_be_new) // FIXME: Don't dispatch to main pool
|
||||
theApp->getIOService().post(boost::bind(&Transaction::saveTransaction, txn));
|
||||
if (may_be_new)
|
||||
theApp->getAuxService().post(boost::bind(&Transaction::saveTransaction, txn));
|
||||
return false;
|
||||
}
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user