Browse Source

Fixed block reward, transaction dialog.

cl-refactor
Gav Wood 10 years ago
parent
commit
5d08a13ce8
  1. 7
      CMakeLists.txt
  2. 6
      alethzero/Transact.cpp
  3. 15
      exp/main.cpp
  4. 1
      libethcore/Common.cpp
  5. 1
      libethcore/Params.cpp
  6. 1
      libethcore/Params.h
  7. 2
      libethereum/State.cpp

7
CMakeLists.txt

@ -44,6 +44,7 @@ option(NOBOOST "No use of boost macros in test functions" OFF)
option(EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" OFF) option(EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" OFF)
option(ETHASHCL "Build in support for GPU mining via OpenCL" ON) option(ETHASHCL "Build in support for GPU mining via OpenCL" ON)
option(JSCONSOLE "Build in javascript console" ON) option(JSCONSOLE "Build in javascript console" ON)
option(FRONTIER "Build for Frontier network" ON)
# propagates CMake configuration options to the compiler # propagates CMake configuration options to the compiler
function(configureProject) function(configureProject)
@ -87,6 +88,10 @@ function(configureProject)
add_definitions(-DNOBOOST) add_definitions(-DNOBOOST)
endif() endif()
if (FRONTIER)
add_definitions(-DETH_FRONTIER)
endif()
add_definitions(-DETH_TRUE) add_definitions(-DETH_TRUE)
endfunction() endfunction()
@ -207,6 +212,7 @@ eth_format_option(TOOLS)
eth_format_option(ETHKEY) eth_format_option(ETHKEY)
eth_format_option(ETHASHCL) eth_format_option(ETHASHCL)
eth_format_option(JSCONSOLE) eth_format_option(JSCONSOLE)
eth_format_option(FRONTIER)
eth_format_option_on_decent_platform(SERPENT) eth_format_option_on_decent_platform(SERPENT)
if (JSCONSOLE) if (JSCONSOLE)
@ -321,6 +327,7 @@ message("-- FATDB Full database exploring ${FATDB}")
message("-- JSONRPC JSON-RPC support ${JSONRPC}") message("-- JSONRPC JSON-RPC support ${JSONRPC}")
message("-- USENPM Javascript source building ${USENPM}") message("-- USENPM Javascript source building ${USENPM}")
message("-- ROCKSDB Prefer rocksdb to leveldb ${ROCKSDB}") message("-- ROCKSDB Prefer rocksdb to leveldb ${ROCKSDB}")
message("-- FRONTIER Default to the Frontier network ${FRONTIER}")
message("------------------------------------------------------------- components") message("------------------------------------------------------------- components")
message("-- MINER Build miner ${MINER}") message("-- MINER Build miner ${MINER}")
message("-- ETHKEY Build wallet tools ${ETHKEY}") message("-- ETHKEY Build wallet tools ${ETHKEY}")

6
alethzero/Transact.cpp

@ -150,7 +150,7 @@ void Transact::updateFee()
ok = true; ok = true;
break; break;
} }
ui->send->setEnabled(ok); // ui->send->setEnabled(ok);
QPalette p = ui->total->palette(); QPalette p = ui->total->palette();
p.setColor(QPalette::WindowText, QColor(ok ? 0x00 : 0x80, 0x00, 0x00)); p.setColor(QPalette::WindowText, QColor(ok ? 0x00 : 0x80, 0x00, 0x00));
ui->total->setPalette(p); ui->total->setPalette(p);
@ -319,7 +319,7 @@ void Transact::rejigData()
auto bail = [&](QString he) { auto bail = [&](QString he) {
m_allGood = false; m_allGood = false;
ui->send->setEnabled(false); // ui->send->setEnabled(false);
ui->code->setHtml(he + htmlInfo); ui->code->setHtml(he + htmlInfo);
}; };
@ -402,7 +402,7 @@ void Transact::rejigData()
updateFee(); updateFee();
ui->code->setHtml(htmlInfo); ui->code->setHtml(htmlInfo);
ui->send->setEnabled(m_allGood); // ui->send->setEnabled(m_allGood);
} }
Secret Transact::findSecret(u256 _totalReq) const Secret Transact::findSecret(u256 _totalReq) const

15
exp/main.cpp

@ -284,7 +284,19 @@ int main()
return 0; return 0;
} }
#elif 1 #elif 1
int main()
{
string sol = contentsString("")
Transaction t(tx, CheckTransaction::None);
Public p = recover(t.signature(), t.sha3(WithoutSignature));
cnote << t.signature().r;
cnote << t.signature().s;
cnote << t.signature().v;
cnote << p;
cnote << toAddress(p);
cnote << t.sender();
}
#elif 0
int main() int main()
{ {
bytes tx = fromHex("f84c01028332dcd58004801ba024843272ee176277535489859cbd275686023fe64aabd158b6fcdf2ae6a1ab6ba02f252a5016a48e5ec8d17aefaf4324d29b9e123fa623dc5a60539b3ad3610c95"); bytes tx = fromHex("f84c01028332dcd58004801ba024843272ee176277535489859cbd275686023fe64aabd158b6fcdf2ae6a1ab6ba02f252a5016a48e5ec8d17aefaf4324d29b9e123fa623dc5a60539b3ad3610c95");
@ -297,7 +309,6 @@ int main()
cnote << toAddress(p); cnote << toAddress(p);
cnote << t.sender(); cnote << t.sender();
} }
#elif 0 #elif 0
void mine(State& s, BlockChain const& _bc, SealEngineFace* _se) void mine(State& s, BlockChain const& _bc, SealEngineFace* _se)
{ {

1
libethcore/Common.cpp

@ -66,6 +66,7 @@ Network resetNetwork(Network _n)
c_minimumDifficulty = 131072; c_minimumDifficulty = 131072;
c_difficultyBoundDivisor = 2048; c_difficultyBoundDivisor = 2048;
c_durationLimit = c_network == Network::Turbo ? 2 : c_network == Network::Olympic ? 8 : 12; c_durationLimit = c_network == Network::Turbo ? 2 : c_network == Network::Olympic ? 8 : 12;
c_blockReward = c_network == Network::Olympic ? (1500 * finney) : (5 * ether);
return _n; return _n;
} }

1
libethcore/Params.cpp

@ -35,6 +35,7 @@ u256 c_gasLimitBoundDivisor;
u256 c_minimumDifficulty; u256 c_minimumDifficulty;
u256 c_difficultyBoundDivisor; u256 c_difficultyBoundDivisor;
u256 c_durationLimit; u256 c_durationLimit;
u256 c_blockReward;
//--- END: AUTOGENERATED FROM /feeStructure.json //--- END: AUTOGENERATED FROM /feeStructure.json
} }

1
libethcore/Params.h

@ -35,6 +35,7 @@ extern u256 c_minimumDifficulty;
extern u256 c_difficultyBoundDivisor; extern u256 c_difficultyBoundDivisor;
extern u256 c_durationLimit; extern u256 c_durationLimit;
extern u256 c_maximumExtraDataSize; extern u256 c_maximumExtraDataSize;
extern u256 c_blockReward;
//--- END: AUTOGENERATED FROM /feeStructure.json //--- END: AUTOGENERATED FROM /feeStructure.json
} }

2
libethereum/State.cpp

@ -31,6 +31,7 @@
#include <libdevcore/TrieHash.h> #include <libdevcore/TrieHash.h>
#include <libevmcore/Instruction.h> #include <libevmcore/Instruction.h>
#include <libethcore/Exceptions.h> #include <libethcore/Exceptions.h>
#include <libethcore/Params.h>
#include <libevm/VMFactory.h> #include <libevm/VMFactory.h>
#include "BlockChain.h" #include "BlockChain.h"
#include "Defaults.h" #include "Defaults.h"
@ -47,7 +48,6 @@ namespace fs = boost::filesystem;
#define ctrace clog(StateTrace) #define ctrace clog(StateTrace)
#define ETH_TIMED_ENACTMENTS 0 #define ETH_TIMED_ENACTMENTS 0
static const u256 c_blockReward = c_network == Network::Olympic ? (1500 * finney) : (5 * ether);
static const unsigned c_maxSyncTransactions = 256; static const unsigned c_maxSyncTransactions = 256;
const char* StateSafeExceptions::name() { return EthViolet "" EthBlue ""; } const char* StateSafeExceptions::name() { return EthViolet "" EthBlue ""; }

Loading…
Cancel
Save