PPCoin: bug fix of GetBlockTrust() introduced with 32ad4f42
authorSunny King <p2pcoin@gmail.com>
Thu, 29 Dec 2011 23:49:32 +0000 (23:49 +0000)
committerSunny King <p2pcoin@gmail.com>
Thu, 29 Dec 2011 23:56:58 +0000 (23:56 +0000)
        getinfo command crashes daemon with only the genesis block

src/main.h

index 1bcad19..6e5cac5 100644 (file)
@@ -1100,7 +1100,7 @@ public:
 
     int64 GetBlockTrust() const
     {
-        return (nChainTrust - pprev->nChainTrust);
+        return (nChainTrust - (pprev? pprev->nChainTrust : 0));
     }
 
     bool IsInMainChain() const