mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-21 14:26:45 +00:00

* [NOD-201] Implemented the AddSubnetwork CLI tool. * [NOD-201] Fixed various bugs in AddSubnetwork. * [NOD-201] Fixed mempool maybeAcceptTransaction verifying gasLimit for a subnetwork registry transaction. * [NOD-201] Fixed serialization/deserialization bugs in addrIndex. * [NOD-201] Fixed BlockConfirmationsByHash not handling the zeroHash. * [NOD-201] Used btclog instead of go log. * [NOD-201] Made gasLimit a command-line flag. Made waitForSubnetworkToBecomeAccepted only return an error. * [NOD-201] Filtered out mempool transactions. * [NOD-201] Fixed embarrassing typos. * [NOD-201] Added subnetwork registry tx fee + appropriate cli flag. * [NOD-201] Skipped TXOs that can't pay for registration.
20 lines
592 B
Go
20 lines
592 B
Go
package main
|
|
|
|
import (
|
|
"github.com/daglabs/btcd/btcec"
|
|
"github.com/daglabs/btcd/util"
|
|
"github.com/daglabs/btcd/util/base58"
|
|
)
|
|
|
|
func decodeKeys(cfg *config) (*btcec.PrivateKey, *util.AddressPubKeyHash, error) {
|
|
privateKeyBytes := base58.Decode(cfg.PrivateKey)
|
|
privateKey, _ := btcec.PrivKeyFromBytes(btcec.S256(), privateKeyBytes)
|
|
serializedPrivateKey := privateKey.PubKey().SerializeCompressed()
|
|
|
|
pubKeyAddr, err := util.NewAddressPubKey(serializedPrivateKey, activeNetParams.Prefix)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
return privateKey, pubKeyAddr.AddressPubKeyHash(), nil
|
|
}
|