diff options
author | Carl Dong <contact@carldong.me> | 2021-04-23 15:18:04 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-05-27 13:49:09 -0400 |
commit | 9ecade14252ad1972f668d2d2e4ef44fdfcb944a (patch) | |
tree | 579a04b623ae8be344e22c848375b18c8fc1fce8 /src/rpc/mining.cpp | |
parent | fc1c282845f6b8436d1ea4c68eb3511034c29bea (diff) |
rest: Add GetChainman function and use it
This is not the cleanest change but:
1. It fixes the erroneous use of RPC's Ensure*() in rest.cpp, which
cause crashes in REST contexts.
RPC code wraps all calls in a try/except, REST code does not.
Ensure*(), being part of RPC, expects that its throw's will get
caught by a try/except. But if you use Ensure*() in REST code, since
it doesn't have a try/except wrap, a crash will happen.
2. It is consistent with other functions like GetMemPool.
Someone can probably make this a bit prettier.
Diffstat (limited to 'src/rpc/mining.cpp')
0 files changed, 0 insertions, 0 deletions