同意するが、ソースからコンパイルする場合、
rpc.cpp
!mapArgs.count("-disablesafemode")
を
mapArgs.count("-safemode")
に変更するだけで
// Observe lockdown
throw runtime_error(strWarning);
となる。
コードはこちらで確認できる:http://bitcoin.svn.sourceforge.net/viewvc/bitcoin/trunk/rpc.cpp?revision=142&view=markup
-enablesafety を使ったときだけエラーを表示するのは少し奇妙だ。これが起きると安全でない、あるいはセキュリティ上問題があるのだろうか?
http://www.bitcoin.org/wiki/doku.php?id=api
コードを理解した限りでは、getinfo、help、stop、getgenerate、setgenerate 以外の http://www.bitcoin.org/wiki/doku.php?id=api のメソッドを使用する際、かつ警告がある場合:
-disablesafemode が実行中のプロセスに渡されていれば、警告は表示されない
-disablesafemode が実行中のプロセスに渡されていなければ、警告が表示される
http://www.cplusplus.com/reference/std/stdexcept/runtime_error/
necrodearia>
http://www.cplusplus.com/reference/std/stdexcept/runtime_error/- Does this cause the running process to stop or does it just produce output to the terminal/shell?
<Adrinael> necrodearia, “this”?
<necrodearia> runtime_error
<Adrinael> necrodearia, if you create a runtime_error object, nothing happens. If you throw a runtime_error object, it all depends on if someone catches it, and where.
<Adrinael> { try { throw runtime_error(“Error, halp!”); } catch (runtime_error& e) { cout << “caught a runtime error: ” << e.what(); } cout << ” but still continuing…”; }
<clang> terminated by runtime_error: Error, halp!
<Adrinael> Hmm awesome
<Adrinael> geordi { try { throw runtime_error(“Error, halp!”); } catch (runtime_error& e) { cout << “caught a runtime error: ” << e.what(); } cout << ” but still continuing…”; }
<geordi> caught a runtime error: Error, halp! but still continuing…
<Sausage> How in the hell did it get that wrong?
<Adrinael> Asked Eelis on #geordi, now move along