mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-25 16:06:18 +00:00
add enable-0x-prefix flag (#194)
This commit is contained in:
parent
f57e2c3577
commit
6a768b04f9
5 changed files with 15 additions and 2 deletions
|
|
@ -165,6 +165,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
|||
common.TIPXDCXCancellationFee = common.TIPXDCXCancellationFeeTestnet
|
||||
}
|
||||
|
||||
if ctx.GlobalBool(utils.Enable0xPrefixFlag.Name) {
|
||||
common.Enable0xPrefix = true;
|
||||
}
|
||||
|
||||
// Rewound
|
||||
if rewound := ctx.GlobalInt(utils.RewoundFlag.Name); rewound != 0 {
|
||||
common.Rewound = uint64(rewound)
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ var (
|
|||
//utils.RinkebyFlag,
|
||||
//utils.VMEnableDebugFlag,
|
||||
utils.XDCTestnetFlag,
|
||||
utils.Enable0xPrefixFlag,
|
||||
utils.RewoundFlag,
|
||||
utils.NetworkIdFlag,
|
||||
utils.RPCCORSDomainFlag,
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@ var (
|
|||
Usage: "Rollback chain at hash",
|
||||
Value: "",
|
||||
}
|
||||
Enable0xPrefixFlag = cli.BoolFlag{
|
||||
Name: "enable-0x-prefix",
|
||||
Usage: "Addres use 0x-prefix (default = false)",
|
||||
}
|
||||
// General settings
|
||||
AnnounceTxsFlag = cli.BoolFlag{
|
||||
Name: "announce-txs",
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ var TIPXDCXCancellationFeeTestnet = big.NewInt(38383838)
|
|||
|
||||
var TIPXDCXTestnet = big.NewInt(38383838)
|
||||
var IsTestnet bool = false
|
||||
var Enable0xPrefix bool = false
|
||||
var StoreRewardFolder string
|
||||
var RollbackHash Hash
|
||||
var BasePrice = big.NewInt(1000000000000000000) // 1
|
||||
|
|
|
|||
|
|
@ -250,8 +250,11 @@ func (a *Address) Set(other Address) {
|
|||
// MarshalText returns the hex representation of a.
|
||||
func (a Address) MarshalText() ([]byte, error) {
|
||||
// Handle '0x' or 'xdc' prefix here.
|
||||
// return hexutil.Bytes(a[:]).MarshalText()
|
||||
return hexutil.Bytes(a[:]).MarshalXDCText()
|
||||
if (Enable0xPrefix) {
|
||||
return hexutil.Bytes(a[:]).MarshalText()
|
||||
} else {
|
||||
return hexutil.Bytes(a[:]).MarshalXDCText()
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText parses a hash in hex syntax.
|
||||
|
|
|
|||
Loading…
Reference in a new issue