aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp6
-rw-r--r--src/rpc/server.h9
2 files changed, 12 insertions, 3 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 2077723af5..169caddc59 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -834,18 +834,18 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash,
{
assert(!outputs.empty());
ss << hash;
- ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase);
+ ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase ? 1u : 0u);
stats.nTransactions++;
for (const auto output : outputs) {
ss << VARINT(output.first + 1);
ss << output.second.out.scriptPubKey;
- ss << VARINT(output.second.out.nValue);
+ ss << VARINT(output.second.out.nValue, VarIntMode::NONNEGATIVE_SIGNED);
stats.nTransactionOutputs++;
stats.nTotalAmount += output.second.out.nValue;
stats.nBogoSize += 32 /* txid */ + 4 /* vout index */ + 4 /* height + coinbase */ + 8 /* amount */ +
2 /* scriptPubKey len */ + output.second.out.scriptPubKey.size() /* scriptPubKey */;
}
- ss << VARINT(0);
+ ss << VARINT(0u);
}
//! Calculate statistics about the unspent transaction output set
diff --git a/src/rpc/server.h b/src/rpc/server.h
index 8b32924fbc..d25268a8ab 100644
--- a/src/rpc/server.h
+++ b/src/rpc/server.h
@@ -165,8 +165,17 @@ public:
/**
* Appends a CRPCCommand to the dispatch table.
+ *
* Returns false if RPC server is already running (dump concurrency protection).
+ *
* Commands cannot be overwritten (returns false).
+ *
+ * Commands with different method names but the same callback function will
+ * be considered aliases, and only the first registered method name will
+ * show up in the help text command listing. Aliased commands do not have
+ * to have the same behavior. Server and client code can distinguish
+ * between calls based on method name, and aliased commands can also
+ * register different names, types, and numbers of parameters.
*/
bool appendCommand(const std::string& name, const CRPCCommand* pcmd);
};