change currency symbol depending on net
authorForrest Voight <forrest@forre.st>
Mon, 15 Aug 2011 05:01:51 +0000 (01:01 -0400)
committerForrest Voight <forrest@forre.st>
Mon, 15 Aug 2011 05:01:51 +0000 (01:01 -0400)
p2pool/bitcoin/data.py
p2pool/ixcoin.py
p2pool/main.py
p2pool/namecoin.py

index 97ed7aa..e87f2eb 100644 (file)
@@ -807,6 +807,7 @@ class Mainnet(object):
         not (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'BTC'
 
 class Testnet(object):
     BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
@@ -819,3 +820,4 @@ class Testnet(object):
         (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'tBTC'
index 9fb92ec..7a5eed9 100644 (file)
@@ -11,6 +11,7 @@ class IxcoinMainnet(object):
         not (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'IXC'
 
 class IxcoinTestnet(object):
     BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
@@ -23,3 +24,4 @@ class IxcoinTestnet(object):
         (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'tIXC'
index 9abbbf5..1c41f93 100644 (file)
@@ -384,7 +384,7 @@ def main(args):
                 block_target=state['target'],
                 net=args.net,
             )
-            print 'Generating! Difficulty: %.06f Payout if block: %.6f BTC' % (0xffff*2**208/p2pool.coinbase_type.unpack(generate_tx['tx_ins'][0]['script'])['share_data']['target'], generate_tx['tx_outs'][-1]['value']*1e-8)
+            print 'Generating! Difficulty: %.06f Payout if block: %.6f %s' % (0xffff*2**208/p2pool.coinbase_type.unpack(generate_tx['tx_ins'][0]['script'])['share_data']['target'], generate_tx['tx_outs'][-1]['value']*1e-8, args.net.BITCOIN_SYMBOL)
             #print 'Target: %x' % (p2pool.coinbase_type.unpack(generate_tx['tx_ins'][0]['script'])['share_data']['target'],)
             #, have', shares.count(my_script) - 2, 'share(s) in the current chain. Fee:', sum(tx.value_in - tx.value_out for tx in extra_txs)/100000000
             transactions = [generate_tx] + [tx.tx for tx in extra_txs]
index 81d6d75..4c98afb 100644 (file)
@@ -11,6 +11,7 @@ class NamecoinMainnet(object):
         not (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'NMC'
 
 class NamecoinTestnet(object):
     BITCOIN_P2P_PREFIX = 'fabfb5fe'.decode('hex')
@@ -23,3 +24,4 @@ class NamecoinTestnet(object):
         (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
+    BITCOIN_SYMBOL = 'tNMC'