dash/src/rpc
Wladimir J. van der Laan 92fbe75181
Merge #19731: net, rpc: expose nLastBlockTime/nLastTXTime as last block/last_transaction in getpeerinfo
5da96210fc2fda9fbd79531f42f91262fd7a9257 doc: release note for getpeerinfo last_block/last_transaction (Jon Atack)
cfef5a2c98b9563392a4a258fedb8bdc869c9749 test: rpc_net.py logging and test naming improvements (Jon Atack)
21c57bacda766a4f56ee75a2872f5d0f94e3901e test: getpeerinfo last_block and last_transaction tests (Jon Atack)
8a560a7d57cbd9f473d6a3782893a0e2243c55bd rpc: expose nLastBlockTime/TXTime as getpeerinfo last_block/transaction (Jon Atack)
02fbe3ae0bd91cbab2828cb7aa46f6493c82f026 net: add nLastBlockTime/TXTime to CNodeStats, CNode::copyStats (Jon Atack)

Pull request description:

  This PR adds inbound peer eviction criteria `nLastBlockTime` and `nLastTXTime` to `CNodeStats` and `CNode::copyStats`, which then allows exposing them in the next commit as `last_transaction` and `last_block` Unix Epoch Time fields in RPC `getpeerinfo`.

  This may be useful for writing missing eviction tests. I'd also like to add `lasttx` and `lastblk` columns to the `-netinfo` dashboard as described in https://github.com/bitcoin/bitcoin/pull/19643#issuecomment-671093420.

  Relevant discussion at the p2p irc meeting http://www.erisian.com.au/bitcoin-core-dev/log-2020-08-11.html#l-549:
  ```text
  <jonatack> i was specifically trying to observe and figure out how to test https://github.com/bitcoin/bitcoin/issues/19500
  <jonatack> which made me realise that i didn't know what was going on with my peer conns in enough detail
  <jonatack> i'm running bitcoin locally with nLastBlockTime and nLastTXTime added to getpeerinfo for my peer connections dashboard
  <jonatack> sipa: is there a good reason why that (eviction criteria) data is not exposed through getpeerinfo currently?
  <sipa> jonatack: nope; i suspect just nobody ever added it
  <jonatack> sipa: thanks. will propose.
  ```

  The last commit is optional, but I think it would be good to have logging in `rpc_net.py`.

ACKs for top commit:
  jnewbery:
    Code review ACK 5da96210fc2fda9fbd79531f42f91262fd7a9257
  theStack:
    Code Review ACK 5da96210fc2fda9fbd79531f42f91262fd7a9257
  darosior:
    ACK 5da96210fc2fda9fbd79531f42f91262fd7a9257

Tree-SHA512: 2db164bc979c014837a676e890869a128beb7cf40114853239e7280f57e768bcb43bff6c1ea76a61556212135281863b5290b50ff9d24fce16c5b89b55d4cd70
2024-01-28 22:20:47 +07:00
..
blockchain.cpp Merge #19765: doc: Fix getmempoolancestors RPC result doc 2024-01-22 19:47:11 -06:00
blockchain.h Merge #18152: qt: Use SynchronizationState enum for signals to GUI 2024-01-10 19:15:47 -06:00
client.cpp feat: new rpc getrawtransactionmulti (#5839) 2024-01-22 19:33:24 -06:00
client.h
coinjoin.cpp refactor: drop global coinJoinWalletManager 2024-01-10 12:06:04 -06:00
evo.cpp refactor: make GetTxPayload return an Optional T instead of taking in a T& return (#5733) 2024-01-11 21:43:01 -06:00
governance.cpp refactor: simplify comparator in rpc/governance 2023-12-21 23:04:44 -06:00
masternode.cpp fix: possible assert call if nHeight in CDeterministicMNList is higher then Tip (#5590) 2023-10-27 19:53:27 -05:00
mining.cpp Merge #19282: RPC: Rephrase generatetoaddress help, and use PACKAGE_NAME 2024-01-16 15:05:07 -06:00
mining.h merge bitcoin#19133: add bitcoin-cli -generate command 2023-04-17 08:30:49 +00:00
misc.cpp refactor: use DeploymentActiveAfter instead llmq::utils in rpc/ 2023-12-21 23:02:31 -06:00
net.cpp Merge #19731: net, rpc: expose nLastBlockTime/nLastTXTime as last block/last_transaction in getpeerinfo 2024-01-28 22:20:47 +07:00
protocol.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
quorums.cpp refactor: split llmq/utils to Quorum Calculation and llmq/options (#5790) 2024-01-17 19:56:41 -06:00
rawtransaction_util.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
rawtransaction_util.h Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
rawtransaction.cpp Merge #19517: psbt: Increment input value sum only once per UTXO in decodepsbt 2024-01-23 22:14:15 -06:00
register.h
request.cpp merge bitcoin#18594: display multiwallet balances in -getinfo 2023-04-17 08:30:49 +00:00
request.h Merge #20530: lint, refactor: Update cppcheck linter to c++17 and improve explicit usage 2023-08-01 12:24:36 -05:00
server.cpp feat(rpc): Asset Unlock status by index (#5776) 2023-12-22 14:27:00 -06:00
server.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
util.cpp fix: add missing includes and remove obsolete includes (#5562) 2023-09-07 09:07:02 -05:00
util.h Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00