From e56fdf457f23bea31829f1330e8aaf6ec28dbf64 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 5 Feb 2016 10:33:11 -0500 Subject: [PATCH] Added network name to bitcoind.getInfo --- integration/regtest.js | 1 + src/libbitcoind.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/integration/regtest.js b/integration/regtest.js index 17f0b8e6..e7dba7a8 100644 --- a/integration/regtest.js +++ b/integration/regtest.js @@ -477,6 +477,7 @@ describe('Daemon Binding Functionality', function() { describe('#getInfo', function() { it('will get information', function() { var info = bitcoind.getInfo(); + info.network.should.equal('regtest'); should.exist(info); should.exist(info.version); should.exist(info.blocks); diff --git a/src/libbitcoind.cc b/src/libbitcoind.cc index b7b87b04..882dabbb 100644 --- a/src/libbitcoind.cc +++ b/src/libbitcoind.cc @@ -1418,6 +1418,7 @@ NAN_METHOD(GetInfo) { Nan::Set(obj, New("connections").ToLocalChecked(), New((int)vNodes.size())->ToInt32()); Nan::Set(obj, New("difficulty").ToLocalChecked(), New((double)GetDifficulty())); Nan::Set(obj, New("testnet").ToLocalChecked(), New(Params().NetworkIDString() == "test")); + Nan::Set(obj, New("network").ToLocalChecked(), New(Params().NetworkIDString()).ToLocalChecked()); Nan::Set(obj, New("relayfee").ToLocalChecked(), New(::minRelayTxFee.GetFeePerK())); // double Nan::Set(obj, New("errors").ToLocalChecked(), New(GetWarnings("statusbar")).ToLocalChecked());