Merge branch 'updateseednodes' of https://github.com/nanotube/bitcoin
authorGavin Andresen <gavinandresen@gmail.com>
Thu, 19 Jan 2012 19:23:49 +0000 (14:23 -0500)
committerGavin Andresen <gavinandresen@gmail.com>
Thu, 19 Jan 2012 19:23:49 +0000 (14:23 -0500)
src/bitcoinrpc.cpp
src/json/json_spirit_reader_template.h
src/main.cpp
src/main.h
src/net.cpp
src/qt/transactionfilterproxy.h
src/util.h

index db595cb..5ac58de 100644 (file)
@@ -1871,7 +1871,10 @@ Value getmemorypool(const Array& params, bool fHelp)
             "  \"previousblockhash\" : hash of current highest block\n"
             "  \"transactions\" : contents of non-coinbase transactions that should be included in the next block\n"
             "  \"coinbasevalue\" : maximum allowable input to coinbase transaction, including the generation award and transaction fees\n"
+            "  \"coinbaseflags\" : data that should be included in coinbase so support for new features can be judged\n"
             "  \"time\" : timestamp appropriate for next block\n"
+            "  \"mintime\" : minimum timestamp appropriate for next block\n"
+            "  \"curtime\" : current timestamp\n"
             "  \"bits\" : compressed target of next block\n"
             "If [data] is specified, tries to solve the block and returns true if it was successful.");
 
@@ -1925,7 +1928,10 @@ Value getmemorypool(const Array& params, bool fHelp)
         result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex()));
         result.push_back(Pair("transactions", transactions));
         result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
+        result.push_back(Pair("coinbaseflags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end())));
         result.push_back(Pair("time", (int64_t)pblock->nTime));
+        result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1));
+        result.push_back(Pair("curtime", (int64_t)GetAdjustedTime()));
 
         union {
             int32_t nBits;
index 4dec00e..12d1e79 100644 (file)
@@ -380,32 +380,32 @@ namespace json_spirit
 
         static void throw_not_value( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "not a value" );
+            throw_error( begin, "not a value" );
         }
 
         static void throw_not_array( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "not an array" );
+            throw_error( begin, "not an array" );
         }
 
         static void throw_not_object( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "not an object" );
+            throw_error( begin, "not an object" );
         }
 
         static void throw_not_pair( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "not a pair" );
+            throw_error( begin, "not a pair" );
         }
 
         static void throw_not_colon( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "no colon in pair" );
+            throw_error( begin, "no colon in pair" );
         }
 
         static void throw_not_string( Iter_type begin, Iter_type end )
         {
-           throw_error( begin, "not a string" );
+            throw_error( begin, "not a string" );
         }
 
         template< typename ScannerT >
index 3c3f066..891dbed 100644 (file)
@@ -3130,12 +3130,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
         hashPrevBlock = pblock->hashPrevBlock;
     }
     ++nExtraNonce;
-    pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nTime << CBigNum(nExtraNonce);
-
-    // Put "/P2SH/" in the coinbase so everybody can tell when
-    // a majority of miners support it
-    const char* pszP2SH = "/P2SH/";
-    pblock->vtx[0].vin[0].scriptSig += CScript() << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
+    pblock->vtx[0].vin[0].scriptSig = (CScript() << pblock->nTime << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
     assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
 
     pblock->hashMerkleRoot = pblock->BuildMerkleTree();
index 678c14c..be5f2f5 100644 (file)
@@ -49,6 +49,12 @@ static const int fHaveUPnP = false;
 #endif
 
 
+// Put "/P2SH/" in the coinbase so everybody can tell when
+// a majority of miners support it
+static const char* pszP2SH = "/P2SH/";
+static const CScript COINBASE_FLAGS = CScript() << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
+
+
 
 
 
index f810f32..a0e093d 100644 (file)
@@ -969,11 +969,11 @@ void ThreadMapPort2(void* parg)
 #ifndef UPNPDISCOVER_SUCCESS
     /* miniupnpc 1.5 */
         r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
-                               port, port, lanaddr, strDesc.c_str(), "TCP", 0);
+                            port, port, lanaddr, strDesc.c_str(), "TCP", 0);
 #else
     /* miniupnpc 1.6 */
         r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
-                               port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
+                            port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
 #endif
 
         if(r!=UPNPCOMMAND_SUCCESS)
index 76cf46f..8d6829d 100644 (file)
@@ -31,7 +31,7 @@ public:
     /** Set maximum number of rows returned, -1 if unlimited. */
     void setLimit(int limit);
 
-    int        rowCount(const QModelIndex &parent = QModelIndex()) const;
+    int rowCount(const QModelIndex &parent = QModelIndex()) const;
 protected:
     bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
 
index 87725b7..19f0652 100644 (file)
@@ -716,8 +716,8 @@ inline bool AffinityBugWorkaround(void(*pfn)(void*))
 
 inline uint32_t ByteReverse(uint32_t value)
 {
-       value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
-       return (value<<16) | (value>>16);
+    value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
+    return (value<<16) | (value>>16);
 }
 
 #endif