Skip to content

Commit 35f0a4e

Browse files
author
Mikael Hirki
committed
PPCoin: Move declaration and initialization of strMintMessage inside BitcoinMiner().
This fixes an assertion failure crash when starting ppcoin-qt. The assertion failure is caused by a static call to the _() function. The issue is fixed by making strMintMessage a non-static local variable inside BitcoinMiner(). Assertion failure message (from Sunny): ppcoin-qt: /usr/include/boost/smart_ptr/shared_ptr.hpp:412: boost::shared_ptr<T>::reference boost::shared_ptr<T>::operator*() const [ with T = <snip> ]: Assertion `px != 0' failed. Backtrace of the crash: #0 0x0000003565435309 in raise () from /lib64/libc.so.6 #1 0x0000003565436668 in abort () from /lib64/libc.so.6 #2 0x000000356542e476 in __assert_fail_base () from /lib64/libc.so.6 bitcoin#3 0x000000356542e522 in __assert_fail () from /lib64/libc.so.6 bitcoin#4 0x0000000000475dbe in operator* (this=<optimized out>) at /usr/include/boost/smart_ptr/shared_ptr.hpp:646 bitcoin#5 operator() (arg1=0x649fd8 "Info: Minting suspended due to locked wallet.", this=<optimized out>) at /usr/include/boost/signals2/detail/signal_template.hpp:695 bitcoin#6 _ (psz=psz@entry=0x649fd8 "Info: Minting suspended due to locked wallet.") at src/ui_interface.h:106 bitcoin#7 0x000000000049f5f7 in __static_initialization_and_destruction_0 (__initialize_p=__initialize_p@entry=1, __priority=__priority@entry=65535) at src/main.cpp:3345 bitcoin#8 0x00000000004af11a in _GLOBAL__sub_I_cs_setpwalletRegistered () at src/main.cpp:5303 bitcoin#9 0x0000000000620d0d in __libc_csu_init () bitcoin#10 0x0000003565421aa5 in __libc_start_main () from /lib64/libc.so.6 bitcoin#11 0x000000000042b9f8 in _start ()
1 parent 05a2bdd commit 35f0a4e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
33423342
extern map<uint256, CAlert> mapAlerts;
33433343
extern CCriticalSection cs_mapAlerts;
33443344

3345-
static string strMintMessage = _("Info: Minting suspended due to locked wallet.");
33463345
static string strMintWarning;
33473346

33483347
string GetWarnings(string strFor)
@@ -5020,6 +5019,8 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
50205019
CReserveKey reservekey(pwallet);
50215020
unsigned int nExtraNonce = 0;
50225021

5022+
string strMintMessage = _("Info: Minting suspended due to locked wallet.");
5023+
50235024
try { loop {
50245025
while (vNodes.empty())
50255026
MilliSleep(1000);

0 commit comments

Comments
 (0)