slickage / baron

Baron is a Bitcoin payment processor that anyone can deploy
163 stars 35 forks source link

Handle bitcoind Safe Mode #18

Open wtogami opened 10 years ago

wtogami commented 10 years ago
23:57:02 web.1  | ===========================
23:57:02 web.1  | Processing Last Block: 0000000073ec735fc882d79b1020fe8ea788a20be29edb8de156513ae1bb0d61
23:57:02 web.1  | ===========================
23:57:02 web.1  | [SyntaxError: Unexpected token S]
23:57:02 web.1  | Error: Last block may have been corrupted. Bitcoind may be out of sync with network.
23:57:02 web.1  | [SyntaxError: Unexpected token S]
23:57:02 web.1  | Error parsing transaction from body: Safe mode: Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. [Host: 127.0.0.1:18332 User:QmHJG1jkmSnhYME Using password:yes]. Code:-2

In this rare event Baron needs to know to stop asking for payments until things return to normal. Baron should refuse to show new payment addresses and instead print an error something like, "Temporary Downtime. Bitcoin is currently in safe mode. Please contact the system administrator."

wtogami commented 10 years ago

Along the same lines as this, Baron should also use alertnotify. Upon receiving any alert, it should stop asking for any payments until the alert is gone from getinfo.

wtogami commented 10 years ago

bitcoind has the -testsafemode option. Please use that once so you obtain the safe mode error message.