[lbry] rename btcd to lbcd
Co-authored-by: Brannon King <countprimes@gmail.com>
This commit is contained in:
parent
369b4f6574
commit
6f5311d7c6
212 changed files with 690 additions and 685 deletions
|
@ -23,8 +23,8 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddrManager provides a concurrency safe address manager for caching potential
|
// AddrManager provides a concurrency safe address manager for caching potential
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// randAddr generates a *wire.NetAddress backed by a random IPv4/IPv6 address.
|
// randAddr generates a *wire.NetAddress backed by a random IPv4/IPv6 address.
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/addrmgr"
|
"github.com/lbryio/lbcd/addrmgr"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// naTest is used to describe a test to be performed against the NetAddressKey
|
// naTest is used to describe a test to be performed against the NetAddressKey
|
||||||
|
|
|
@ -7,7 +7,7 @@ package addrmgr
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TstKnownAddressIsBad(ka *KnownAddress) bool {
|
func TstKnownAddressIsBad(ka *KnownAddress) bool {
|
||||||
|
|
|
@ -7,7 +7,7 @@ package addrmgr
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KnownAddress tracks information about a known network address that is used
|
// KnownAddress tracks information about a known network address that is used
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/addrmgr"
|
"github.com/lbryio/lbcd/addrmgr"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestChance(t *testing.T) {
|
func TestChance(t *testing.T) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/addrmgr"
|
"github.com/lbryio/lbcd/addrmgr"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestIPTypes ensures the various functions which determine the type of an IP
|
// TestIPTypes ensures the various functions which determine the type of an IP
|
||||||
|
|
|
@ -7,8 +7,8 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// maybeAcceptBlock potentially accepts a block into the block chain and, if
|
// maybeAcceptBlock potentially accepts a block into the block chain and, if
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// blockStatus is a bit field representing the validation state of the block.
|
// blockStatus is a bit field representing the validation state of the block.
|
||||||
|
|
|
@ -11,14 +11,14 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/claimtrie"
|
"github.com/lbryio/lbcd/claimtrie"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestHaveBlock tests the HaveBlock API to ensure proper functionality.
|
// TestHaveBlock tests the HaveBlock API to ensure proper functionality.
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestErrNotInMainChain ensures the functions related to errNotInMainChain work
|
// TestErrNotInMainChain ensures the functions related to errNotInMainChain work
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testNoncePrng provides a deterministic prng for the nonce in generated fake
|
// testNoncePrng provides a deterministic prng for the nonce in generated fake
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckpointConfirmations is the number of blocks before the end of the current
|
// CheckpointConfirmations is the number of blocks before the end of the current
|
||||||
|
|
|
@ -6,14 +6,14 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/claimtrie"
|
"github.com/lbryio/lbcd/claimtrie"
|
||||||
"github.com/btcsuite/btcd/claimtrie/change"
|
"github.com/lbryio/lbcd/claimtrie/change"
|
||||||
"github.com/btcsuite/btcd/claimtrie/node"
|
"github.com/lbryio/lbcd/claimtrie/node"
|
||||||
"github.com/btcsuite/btcd/claimtrie/normalization"
|
"github.com/lbryio/lbcd/claimtrie/normalization"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *BlockChain) SetClaimtrieHeader(block *btcutil.Block, view *UtxoViewpoint) error {
|
func (b *BlockChain) SetClaimtrieHeader(block *btcutil.Block, view *UtxoViewpoint) error {
|
||||||
|
|
|
@ -14,13 +14,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
package blockchain
|
package blockchain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/lbryio/lbcd/btcec"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
)
|
)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This example demonstrates how to create a new chain instance and use
|
// This example demonstrates how to create a new chain instance and use
|
||||||
|
|
|
@ -12,15 +12,15 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/blockchain/fullblocktests"
|
"github.com/lbryio/lbcd/blockchain/fullblocktests"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -18,13 +18,13 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/lbryio/lbcd/btcec"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newHashFromStr converts the passed big-endian hex string into a
|
// newHashFromStr converts the passed big-endian hex string into a
|
||||||
|
|
|
@ -9,13 +9,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// addrIndexBucket provides a mock address index database bucket by implementing
|
// addrIndexBucket provides a mock address index database bucket by implementing
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btclog"
|
"github.com/btcsuite/btclog"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// blockProgressLogger provides periodic logging for other services in order
|
// blockProgressLogger provides periodic logging for other services in order
|
||||||
|
|
|
@ -7,14 +7,14 @@ package indexers
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
"github.com/btcsuite/btcutil/gcs"
|
"github.com/lbryio/lbcutil/gcs"
|
||||||
"github.com/btcsuite/btcutil/gcs/builder"
|
"github.com/lbryio/lbcutil/gcs/builder"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,11 +8,11 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,11 +8,11 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -183,7 +183,7 @@ func (m *medianTime) AddTimeSample(sourceID string, timeVal time.Time) {
|
||||||
// Warn if none of the time samples are close.
|
// Warn if none of the time samples are close.
|
||||||
if !remoteHasCloseTime {
|
if !remoteHasCloseTime {
|
||||||
log.Warnf("Please check your date and time " +
|
log.Warnf("Please check your date and time " +
|
||||||
"are correct! btcd will not work " +
|
"are correct! lbcd will not work " +
|
||||||
"properly with an invalid time")
|
"properly with an invalid time")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BehaviorFlags is a bitmask defining tweaks to the normal behavior when
|
// BehaviorFlags is a bitmask defining tweaks to the normal behavior when
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// txValidateItem holds a transaction along with which input to validate.
|
// txValidateItem holds a transaction along with which input to validate.
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestCheckBlockScripts ensures that validating the all of the scripts in a
|
// TestCheckBlockScripts ensures that validating the all of the scripts in a
|
||||||
|
|
|
@ -7,7 +7,7 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ThresholdState define the various threshold states used when voting on
|
// ThresholdState define the various threshold states used when voting on
|
||||||
|
|
|
@ -7,7 +7,7 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestThresholdStateStringer tests the stringized output for the
|
// TestThresholdStateStringer tests the stringized output for the
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,11 +7,11 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// txoFlags is a bitmask defining additional information and state for a
|
// txoFlags is a bitmask defining additional information and state for a
|
||||||
|
|
|
@ -11,11 +11,11 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -5,15 +5,16 @@
|
||||||
package blockchain
|
package blockchain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/hex"
|
||||||
"math"
|
"math"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestSequenceLocksActive tests the SequenceLockActive function to ensure it
|
// TestSequenceLocksActive tests the SequenceLockActive function to ensure it
|
||||||
|
|
|
@ -7,7 +7,7 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -7,9 +7,9 @@ package blockchain
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/lbryio/lbcd/btcec"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This example demonstrates signing a message with a secp256k1 private key that
|
// This example demonstrates signing a message with a secp256k1 private key that
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/lbryio/lbcd/btcec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestBtcdExtCmds tests all of the btcd extended commands marshal and unmarshal
|
// TestBtcdExtCmds tests all of the btcd extended commands marshal and unmarshal
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestBtcdExtCustomResults ensures any results that have custom marshalling
|
// TestBtcdExtCustomResults ensures any results that have custom marshalling
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestBtcWalletExtCmds tests all of the btcwallet extended commands marshal and
|
// TestBtcWalletExtCmds tests all of the btcwallet extended commands marshal and
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddNodeSubCmd defines the type used in the addnode JSON-RPC command for the
|
// AddNodeSubCmd defines the type used in the addnode JSON-RPC command for the
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestChainSvrCmds tests all of the chain server commands marshal and unmarshal
|
// TestChainSvrCmds tests all of the chain server commands marshal and unmarshal
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetBlockHeaderVerboseResult models the data from the getblockheader command when
|
// GetBlockHeaderVerboseResult models the data from the getblockheader command when
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestChainSvrCustomResults ensures any results that have custom marshalling
|
// TestChainSvrCustomResults ensures any results that have custom marshalling
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestChainSvrWsCmds tests all of the chain server websocket-specific commands
|
// TestChainSvrWsCmds tests all of the chain server websocket-specific commands
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestChainSvrWsNtfns tests all of the chain server websocket-specific
|
// TestChainSvrWsNtfns tests all of the chain server websocket-specific
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestChainSvrWsResults ensures any results that have custom marshalling
|
// TestChainSvrWsResults ensures any results that have custom marshalling
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestCmdMethod tests the CmdMethod function to ensure it retunrs the expected
|
// TestCmdMethod tests the CmdMethod function to ensure it retunrs the expected
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestAssignField tests the assignField function handles supported combinations
|
// TestAssignField tests the assignField function handles supported combinations
|
||||||
|
|
|
@ -7,7 +7,7 @@ package btcjson_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestErrorCodeStringer tests the stringized output for the ErrorCode type.
|
// TestErrorCodeStringer tests the stringized output for the ErrorCode type.
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This example demonstrates how to create and marshal a command into a JSON-RPC
|
// This example demonstrates how to create and marshal a command into a JSON-RPC
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestHelpReflectInternals ensures the various help functions which deal with
|
// TestHelpReflectInternals ensures the various help functions which deal with
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestHelpers tests the various helper functions which create pointers to
|
// TestHelpers tests the various helper functions which create pointers to
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestIsValidIDType ensures the IsValidIDType function behaves as expected.
|
// TestIsValidIDType ensures the IsValidIDType function behaves as expected.
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestUsageFlagStringer tests the stringized output for the UsageFlag type.
|
// TestUsageFlagStringer tests the stringized output for the UsageFlag type.
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.
|
// AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.
|
||||||
|
@ -1029,7 +1029,7 @@ type WalletCreateFundedPsbtOpts struct {
|
||||||
ChangeType *ChangeType `json:"change_type,omitempty"`
|
ChangeType *ChangeType `json:"change_type,omitempty"`
|
||||||
IncludeWatching *bool `json:"includeWatching,omitempty"`
|
IncludeWatching *bool `json:"includeWatching,omitempty"`
|
||||||
LockUnspents *bool `json:"lockUnspents,omitempty"`
|
LockUnspents *bool `json:"lockUnspents,omitempty"`
|
||||||
FeeRate *int64 `json:"feeRate,omitempty"`
|
FeeRate *float64 `json:"feeRate,omitempty"`
|
||||||
SubtractFeeFromOutputs *[]int64 `json:"subtractFeeFromOutputs,omitempty"`
|
SubtractFeeFromOutputs *[]int64 `json:"subtractFeeFromOutputs,omitempty"`
|
||||||
Replaceable *bool `json:"replaceable,omitempty"`
|
Replaceable *bool `json:"replaceable,omitempty"`
|
||||||
ConfTarget *int64 `json:"conf_target,omitempty"`
|
ConfTarget *int64 `json:"conf_target,omitempty"`
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestWalletSvrCmds tests all of the wallet server commands marshal and
|
// TestWalletSvrCmds tests all of the wallet server commands marshal and
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/lbryio/lbcd/txscript"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateWalletResult models the result of the createwallet command.
|
// CreateWalletResult models the result of the createwallet command.
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/txscript"
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
"github.com/lbryio/lbcd/txscript"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestGetAddressInfoResult ensures that custom unmarshalling of
|
// TestGetAddressInfoResult ensures that custom unmarshalling of
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestWalletSvrWsCmds tests all of the wallet server websocket-specific
|
// TestWalletSvrWsCmds tests all of the wallet server websocket-specific
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestWalletSvrWsNtfns tests all of the chain server websocket-specific
|
// TestWalletSvrWsNtfns tests all of the chain server websocket-specific
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
// "fmt"
|
// "fmt"
|
||||||
// "log"
|
// "log"
|
||||||
//
|
//
|
||||||
// "github.com/btcsuite/btcutil"
|
// btcutil "github.com/lbryio/lbcutil"
|
||||||
// "github.com/btcsuite/btcd/chaincfg"
|
// "github.com/lbryio/lbcd/chaincfg"
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network")
|
// var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network")
|
||||||
|
|
|
@ -7,8 +7,8 @@ package chaincfg
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// genesisCoinbaseTx is the coinbase transaction for the genesis blocks for
|
// genesisCoinbaseTx is the coinbase transaction for the genesis blocks for
|
||||||
|
|
|
@ -13,8 +13,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These variables are the chain proof-of-work limit parameters for each default
|
// These variables are the chain proof-of-work limit parameters for each default
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/btcsuite/btcd/chaincfg"
|
. "github.com/lbryio/lbcd/chaincfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Define some of the required parameters for a user-registered
|
// Define some of the required parameters for a user-registered
|
||||||
|
|
|
@ -8,11 +8,11 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
|
||||||
"github.com/btcsuite/btcd/blockchain/indexers"
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
"github.com/btcsuite/btcd/limits"
|
|
||||||
"github.com/btcsuite/btclog"
|
"github.com/btcsuite/btclog"
|
||||||
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
|
"github.com/lbryio/lbcd/blockchain/indexers"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
|
"github.com/lbryio/lbcd/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,12 +9,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
|
"github.com/lbryio/lbcd/wire"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -24,7 +24,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
@ -35,7 +35,7 @@ var (
|
||||||
// See loadConfig for details on the configuration load process.
|
// See loadConfig for details on the configuration load process.
|
||||||
type config struct {
|
type config struct {
|
||||||
AddrIndex bool `long:"addrindex" description:"Build a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
AddrIndex bool `long:"addrindex" description:"Build a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
||||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||||
InFile string `short:"i" long:"infile" description:"File containing the block(s)"`
|
InFile string `short:"i" long:"infile" description:"File containing the block(s)"`
|
||||||
Progress int `short:"p" long:"progress" description:"Show a progress message each time this number of seconds have passed -- Use 0 to disable progress announcements"`
|
Progress int `short:"p" long:"progress" description:"Show a progress message each time this number of seconds have passed -- Use 0 to disable progress announcements"`
|
||||||
|
@ -67,7 +67,7 @@ func validDbType(dbType string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// netName returns the name used when referring to a bitcoin network. At the
|
// netName returns the name used when referring to a bitcoin network. At the
|
||||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||||
// data and log directory "testnet", which does not match the Name field of the
|
// data and log directory "testnet", which does not match the Name field of the
|
||||||
// chaincfg parameters. This function can be used to override this directory name
|
// chaincfg parameters. This function can be used to override this directory name
|
||||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||||
|
|
|
@ -11,12 +11,12 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/blockchain/indexers"
|
"github.com/lbryio/lbcd/blockchain/indexers"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var zeroHash = chainhash.Hash{}
|
var zeroHash = chainhash.Hash{}
|
||||||
|
|
|
@ -9,12 +9,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
|
"github.com/lbryio/lbcd/wire"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -25,7 +25,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||||
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
defaultDataDir = filepath.Join(btcdHomeDir, "data")
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
@ -35,7 +35,7 @@ var (
|
||||||
//
|
//
|
||||||
// See loadConfig for details on the configuration load process.
|
// See loadConfig for details on the configuration load process.
|
||||||
type config struct {
|
type config struct {
|
||||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||||
UseGoOutput bool `short:"g" long:"gooutput" description:"Display the candidates using Go syntax that is ready to insert into the btcchain checkpoint list"`
|
UseGoOutput bool `short:"g" long:"gooutput" description:"Display the candidates using Go syntax that is ready to insert into the btcchain checkpoint list"`
|
||||||
NumCandidates int `short:"n" long:"numcandidates" description:"Max num of checkpoint candidates to show {1-20}"`
|
NumCandidates int `short:"n" long:"numcandidates" description:"Max num of checkpoint candidates to show {1-20}"`
|
||||||
|
@ -56,7 +56,7 @@ func validDbType(dbType string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// netName returns the name used when referring to a bitcoin network. At the
|
// netName returns the name used when referring to a bitcoin network. At the
|
||||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||||
// data and log directory "testnet", which does not match the Name field of the
|
// data and log directory "testnet", which does not match the Name field of the
|
||||||
// chaincfg parameters. This function can be used to override this directory name
|
// chaincfg parameters. This function can be used to override this directory name
|
||||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
const blockDbNamePrefix = "blocks"
|
const blockDbNamePrefix = "blocks"
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
|
@ -13,10 +13,10 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -27,10 +27,10 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||||
btcctlHomeDir = btcutil.AppDataDir("btcctl", false)
|
btcctlHomeDir = btcutil.AppDataDir("lbcctl", false)
|
||||||
btcwalletHomeDir = btcutil.AppDataDir("btcwallet", false)
|
btcwalletHomeDir = btcutil.AppDataDir("lbcwallet", false)
|
||||||
defaultConfigFile = filepath.Join(btcctlHomeDir, "btcctl.conf")
|
defaultConfigFile = filepath.Join(btcctlHomeDir, "lbcctl.conf")
|
||||||
defaultRPCServer = "localhost"
|
defaultRPCServer = "localhost"
|
||||||
defaultRPCCertFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
defaultRPCCertFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
||||||
defaultWalletCertFile = filepath.Join(btcwalletHomeDir, "rpc.cert")
|
defaultWalletCertFile = filepath.Join(btcwalletHomeDir, "rpc.cert")
|
||||||
|
@ -137,7 +137,7 @@ func normalizeAddress(addr string, chain *chaincfg.Params, useWallet bool) (stri
|
||||||
paramErr := fmt.Errorf("cannot use -wallet with -regtest, btcwallet not yet compatible with regtest")
|
paramErr := fmt.Errorf("cannot use -wallet with -regtest, btcwallet not yet compatible with regtest")
|
||||||
return "", paramErr
|
return "", paramErr
|
||||||
} else {
|
} else {
|
||||||
defaultPort = "18334"
|
defaultPort = "29245"
|
||||||
}
|
}
|
||||||
case &chaincfg.SigNetParams:
|
case &chaincfg.SigNetParams:
|
||||||
if useWallet {
|
if useWallet {
|
||||||
|
@ -231,9 +231,9 @@ func loadConfig() (*config, []string, error) {
|
||||||
// Use config file for RPC server to create default btcctl config
|
// Use config file for RPC server to create default btcctl config
|
||||||
var serverConfigPath string
|
var serverConfigPath string
|
||||||
if preCfg.Wallet {
|
if preCfg.Wallet {
|
||||||
serverConfigPath = filepath.Join(btcwalletHomeDir, "btcwallet.conf")
|
serverConfigPath = filepath.Join(btcwalletHomeDir, "lbcwallet.conf")
|
||||||
} else {
|
} else {
|
||||||
serverConfigPath = filepath.Join(btcdHomeDir, "btcd.conf")
|
serverConfigPath = filepath.Join(btcdHomeDir, "lbcd.conf")
|
||||||
}
|
}
|
||||||
|
|
||||||
err := createDefaultConfigFile(preCfg.ConfigFile, serverConfigPath)
|
err := createDefaultConfigFile(preCfg.ConfigFile, serverConfigPath)
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
|
||||||
"github.com/btcsuite/go-socks/socks"
|
"github.com/btcsuite/go-socks/socks"
|
||||||
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newHTTPClient returns a new HTTP client that is configured according to the
|
// newHTTPClient returns a new HTTP client that is configured according to the
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
|
@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
|
||||||
const (
|
const (
|
||||||
appMajor uint = 0
|
appMajor uint = 0
|
||||||
appMinor uint = 22
|
appMinor uint = 22
|
||||||
appPatch uint = 0
|
appPatch uint = 100
|
||||||
|
|
||||||
// appPreRelease MUST only contain characters from semanticAlphabet
|
// appPreRelease MUST only contain characters from semanticAlphabet
|
||||||
// per the semantic versioning spec.
|
// per the semantic versioning spec.
|
36
config.go
36
config.go
|
@ -21,25 +21,25 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
|
||||||
"github.com/btcsuite/btcd/connmgr"
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
|
||||||
"github.com/btcsuite/btcd/mempool"
|
|
||||||
"github.com/btcsuite/btcd/peer"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
"github.com/btcsuite/go-socks/socks"
|
"github.com/btcsuite/go-socks/socks"
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
|
"github.com/lbryio/lbcd/connmgr"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
|
"github.com/lbryio/lbcd/mempool"
|
||||||
|
"github.com/lbryio/lbcd/peer"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultConfigFilename = "btcd.conf"
|
defaultConfigFilename = "lbcd.conf"
|
||||||
defaultDataDirname = "data"
|
defaultDataDirname = "data"
|
||||||
defaultLogLevel = "info"
|
defaultLogLevel = "info"
|
||||||
defaultLogDirname = "logs"
|
defaultLogDirname = "logs"
|
||||||
defaultLogFilename = "btcd.log"
|
defaultLogFilename = "lbcd.log"
|
||||||
defaultMaxPeers = 125
|
defaultMaxPeers = 125
|
||||||
defaultBanDuration = time.Hour * 24
|
defaultBanDuration = time.Hour * 24
|
||||||
defaultBanThreshold = 100
|
defaultBanThreshold = 100
|
||||||
|
@ -62,13 +62,13 @@ const (
|
||||||
defaultMaxOrphanTransactions = 100
|
defaultMaxOrphanTransactions = 100
|
||||||
defaultMaxOrphanTxSize = 100000
|
defaultMaxOrphanTxSize = 100000
|
||||||
defaultSigCacheMaxSize = 100000
|
defaultSigCacheMaxSize = 100000
|
||||||
sampleConfigFilename = "sample-btcd.conf"
|
sampleConfigFilename = "sample-lbcd.conf"
|
||||||
defaultTxIndex = false
|
defaultTxIndex = false
|
||||||
defaultAddrIndex = false
|
defaultAddrIndex = false
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultHomeDir = btcutil.AppDataDir("btcd", false)
|
defaultHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||||
defaultConfigFile = filepath.Join(defaultHomeDir, defaultConfigFilename)
|
defaultConfigFile = filepath.Join(defaultHomeDir, defaultConfigFilename)
|
||||||
defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirname)
|
defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirname)
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
|
@ -97,8 +97,8 @@ type config struct {
|
||||||
AddCheckpoints []string `long:"addcheckpoint" description:"Add a custom checkpoint. Format: '<height>:<hash>'"`
|
AddCheckpoints []string `long:"addcheckpoint" description:"Add a custom checkpoint. Format: '<height>:<hash>'"`
|
||||||
AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
|
AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
|
||||||
AddrIndex bool `long:"addrindex" description:"Maintain a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
AddrIndex bool `long:"addrindex" description:"Maintain a full address-based transaction index which makes the searchrawtransactions RPC available"`
|
||||||
AgentBlacklist []string `long:"agentblacklist" description:"A comma separated list of user-agent substrings which will cause btcd to reject any peers whose user-agent contains any of the blacklisted substrings."`
|
AgentBlacklist []string `long:"agentblacklist" description:"A comma separated list of user-agent substrings which will cause lbcd to reject any peers whose user-agent contains any of the blacklisted substrings."`
|
||||||
AgentWhitelist []string `long:"agentwhitelist" description:"A comma separated list of user-agent substrings which will cause btcd to require all peers' user-agents to contain one of the whitelisted substrings. The blacklist is applied before the blacklist, and an empty whitelist will allow all agents that do not fail the blacklist."`
|
AgentWhitelist []string `long:"agentwhitelist" description:"A comma separated list of user-agent substrings which will cause lbcd to require all peers' user-agents to contain one of the whitelisted substrings. The blacklist is applied before the blacklist, and an empty whitelist will allow all agents that do not fail the blacklist."`
|
||||||
BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"`
|
BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"`
|
||||||
BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."`
|
BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."`
|
||||||
BlockMaxSize uint32 `long:"blockmaxsize" description:"Maximum block size in bytes to be used when creating a block"`
|
BlockMaxSize uint32 `long:"blockmaxsize" description:"Maximum block size in bytes to be used when creating a block"`
|
||||||
|
@ -126,7 +126,7 @@ type config struct {
|
||||||
MaxOrphanTxs int `long:"maxorphantx" description:"Max number of orphan transactions to keep in memory"`
|
MaxOrphanTxs int `long:"maxorphantx" description:"Max number of orphan transactions to keep in memory"`
|
||||||
MaxPeers int `long:"maxpeers" description:"Max number of inbound and outbound peers"`
|
MaxPeers int `long:"maxpeers" description:"Max number of inbound and outbound peers"`
|
||||||
MiningAddrs []string `long:"miningaddr" description:"Add the specified payment address to the list of addresses to use for generated blocks -- At least one address is required if the generate option is set"`
|
MiningAddrs []string `long:"miningaddr" description:"Add the specified payment address to the list of addresses to use for generated blocks -- At least one address is required if the generate option is set"`
|
||||||
MinRelayTxFee float64 `long:"minrelaytxfee" description:"The minimum transaction fee in BTC/kB to be considered a non-zero fee."`
|
MinRelayTxFee float64 `long:"minrelaytxfee" description:"The minimum transaction fee in LBC/kB to be considered a non-zero fee."`
|
||||||
DisableBanning bool `long:"nobanning" description:"Disable banning of misbehaving peers"`
|
DisableBanning bool `long:"nobanning" description:"Disable banning of misbehaving peers"`
|
||||||
NoCFilters bool `long:"nocfilters" description:"Disable committed filtering (CF) support"`
|
NoCFilters bool `long:"nocfilters" description:"Disable committed filtering (CF) support"`
|
||||||
DisableCheckpoints bool `long:"nocheckpoints" description:"Disable built-in checkpoints. Don't do this unless you know what you're doing."`
|
DisableCheckpoints bool `long:"nocheckpoints" description:"Disable built-in checkpoints. Don't do this unless you know what you're doing."`
|
||||||
|
@ -407,7 +407,7 @@ func newConfigParser(cfg *config, so *serviceOptions, options flags.Options) *fl
|
||||||
// 3) Load configuration file overwriting defaults with any specified options
|
// 3) Load configuration file overwriting defaults with any specified options
|
||||||
// 4) Parse CLI options and overwrite/add any specified options
|
// 4) Parse CLI options and overwrite/add any specified options
|
||||||
//
|
//
|
||||||
// The above results in btcd functioning properly without any config settings
|
// The above results in lbcd functioning properly without any config settings
|
||||||
// while still allowing the user to override settings with config files and
|
// while still allowing the user to override settings with config files and
|
||||||
// command line options. Command line options always take precedence.
|
// command line options. Command line options always take precedence.
|
||||||
func loadConfig() (*config, []string, error) {
|
func loadConfig() (*config, []string, error) {
|
||||||
|
@ -1136,7 +1136,7 @@ func loadConfig() (*config, []string, error) {
|
||||||
return &cfg, remainingArgs, nil
|
return &cfg, remainingArgs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// createDefaultConfig copies the file sample-btcd.conf to the given destination path,
|
// createDefaultConfig copies the file sample-lbcd.conf to the given destination path,
|
||||||
// and populates it with some randomly generated RPC username and password.
|
// and populates it with some randomly generated RPC username and password.
|
||||||
func createDefaultConfigFile(destinationPath string) error {
|
func createDefaultConfigFile(destinationPath string) error {
|
||||||
// Create the destination directory if it does not exists
|
// Create the destination directory if it does not exists
|
||||||
|
|
|
@ -20,16 +20,16 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatalf("Failed finding config file path")
|
t.Fatalf("Failed finding config file path")
|
||||||
}
|
}
|
||||||
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-btcd.conf")
|
sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-lbcd.conf")
|
||||||
|
|
||||||
// Setup a temporary directory
|
// Setup a temporary directory
|
||||||
tmpDir, err := ioutil.TempDir("", "btcd")
|
tmpDir, err := ioutil.TempDir("", "lbcd")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed creating a temporary directory: %v", err)
|
t.Fatalf("Failed creating a temporary directory: %v", err)
|
||||||
}
|
}
|
||||||
testpath := filepath.Join(tmpDir, "test.conf")
|
testpath := filepath.Join(tmpDir, "test.conf")
|
||||||
|
|
||||||
// copy config file to location of btcd binary
|
// copy config file to location of lbcd binary
|
||||||
data, err := ioutil.ReadFile(sampleConfigFile)
|
data, err := ioutil.ReadFile(sampleConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed reading sample config file: %v", err)
|
t.Fatalf("Failed reading sample config file: %v", err)
|
||||||
|
@ -38,7 +38,7 @@ func TestCreateDefaultConfigFile(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed obtaining app path: %v", err)
|
t.Fatalf("Failed obtaining app path: %v", err)
|
||||||
}
|
}
|
||||||
tmpConfigFile := filepath.Join(appPath, "sample-btcd.conf")
|
tmpConfigFile := filepath.Join(appPath, "sample-lbcd.conf")
|
||||||
err = ioutil.WriteFile(tmpConfigFile, data, 0644)
|
err = ioutil.WriteFile(tmpConfigFile, data, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed copying sample config file: %v", err)
|
t.Fatalf("Failed copying sample config file: %v", err)
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
// fetchBlockCmd defines the configuration options for the fetchblock command.
|
// fetchBlockCmd defines the configuration options for the fetchblock command.
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
// blockRegionCmd defines the configuration options for the fetchblockregion
|
// blockRegionCmd defines the configuration options for the fetchblockregion
|
||||||
|
|
|
@ -10,15 +10,15 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
btcdHomeDir = btcutil.AppDataDir("lbcd", false)
|
||||||
knownDbTypes = database.SupportedDrivers()
|
knownDbTypes = database.SupportedDrivers()
|
||||||
activeNetParams = &chaincfg.MainNetParams
|
activeNetParams = &chaincfg.MainNetParams
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ var (
|
||||||
|
|
||||||
// config defines the global configuration options.
|
// config defines the global configuration options.
|
||||||
type config struct {
|
type config struct {
|
||||||
DataDir string `short:"b" long:"datadir" description:"Location of the btcd data directory"`
|
DataDir string `short:"b" long:"datadir" description:"Location of the lbcd data directory"`
|
||||||
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
DbType string `long:"dbtype" description:"Database backend to use for the Block Chain"`
|
||||||
RegressionTest bool `long:"regtest" description:"Use the regression test network"`
|
RegressionTest bool `long:"regtest" description:"Use the regression test network"`
|
||||||
SimNet bool `long:"simnet" description:"Use the simulation test network"`
|
SimNet bool `long:"simnet" description:"Use the simulation test network"`
|
||||||
|
@ -60,7 +60,7 @@ func validDbType(dbType string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// netName returns the name used when referring to a bitcoin network. At the
|
// netName returns the name used when referring to a bitcoin network. At the
|
||||||
// time of writing, btcd currently places blocks for testnet version 3 in the
|
// time of writing, lbcd currently places blocks for testnet version 3 in the
|
||||||
// data and log directory "testnet", which does not match the Name field of the
|
// data and log directory "testnet", which does not match the Name field of the
|
||||||
// chaincfg parameters. This function can be used to override this directory name
|
// chaincfg parameters. This function can be used to override this directory name
|
||||||
// as "testnet" when the passed active network matches wire.TestNet3.
|
// as "testnet" when the passed active network matches wire.TestNet3.
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// importCmd defines the configuration options for the insecureimport command.
|
// importCmd defines the configuration options for the insecureimport command.
|
||||||
|
|
|
@ -7,8 +7,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
// headersCmd defines the configuration options for the loadheaders command.
|
// headersCmd defines the configuration options for the loadheaders command.
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
"github.com/btcsuite/btclog"
|
"github.com/btcsuite/btclog"
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestErrorCodeStringer tests the stringized output for the ErrorCode type.
|
// TestErrorCodeStringer tests the stringized output for the ErrorCode type.
|
||||||
|
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
_ "github.com/btcsuite/btcd/database/ffldb"
|
_ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This example demonstrates creating a new database.
|
// This example demonstrates creating a new database.
|
||||||
|
@ -22,8 +22,8 @@ func ExampleCreate() {
|
||||||
// This example assumes the ffldb driver is imported.
|
// This example assumes the ffldb driver is imported.
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "github.com/btcsuite/btcd/database"
|
// "github.com/lbryio/lbcd/database"
|
||||||
// _ "github.com/btcsuite/btcd/database/ffldb"
|
// _ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
// )
|
// )
|
||||||
|
|
||||||
// Create a database and schedule it to be closed and removed on exit.
|
// Create a database and schedule it to be closed and removed on exit.
|
||||||
|
@ -48,8 +48,8 @@ func Example_basicUsage() {
|
||||||
// This example assumes the ffldb driver is imported.
|
// This example assumes the ffldb driver is imported.
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "github.com/btcsuite/btcd/database"
|
// "github.com/lbryio/lbcd/database"
|
||||||
// _ "github.com/btcsuite/btcd/database/ffldb"
|
// _ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
// )
|
// )
|
||||||
|
|
||||||
// Create a database and schedule it to be closed and removed on exit.
|
// Create a database and schedule it to be closed and removed on exit.
|
||||||
|
@ -114,8 +114,8 @@ func Example_blockStorageAndRetrieval() {
|
||||||
// This example assumes the ffldb driver is imported.
|
// This example assumes the ffldb driver is imported.
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "github.com/btcsuite/btcd/database"
|
// "github.com/lbryio/lbcd/database"
|
||||||
// _ "github.com/btcsuite/btcd/database/ffldb"
|
// _ "github.com/lbryio/lbcd/database/ffldb"
|
||||||
// )
|
// )
|
||||||
|
|
||||||
// Create a database and schedule it to be closed and removed on exit.
|
// Create a database and schedule it to be closed and removed on exit.
|
||||||
|
@ -173,5 +173,5 @@ func Example_blockStorageAndRetrieval() {
|
||||||
fmt.Printf("Serialized block size: %d bytes\n", len(loadedBlockBytes))
|
fmt.Printf("Serialized block size: %d bytes\n", len(loadedBlockBytes))
|
||||||
|
|
||||||
// Output:
|
// Output:
|
||||||
// Serialized block size: 285 bytes
|
// Serialized block size: 229 bytes
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcutil"
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkBlockHeader benchmarks how long it takes to load the mainnet genesis
|
// BenchmarkBlockHeader benchmarks how long it takes to load the mainnet genesis
|
||||||
|
|
|
@ -17,9 +17,9 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
"github.com/btcsuite/btcd/database"
|
"github.com/lbryio/lbcd/database"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/lbryio/lbcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -14,11 +14,6 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
|
||||||
"github.com/btcsuite/btcd/database"
|
|
||||||
"github.com/btcsuite/btcd/database/internal/treap"
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
|
||||||
"github.com/btcsuite/btcutil"
|
|
||||||
"github.com/btcsuite/goleveldb/leveldb"
|
"github.com/btcsuite/goleveldb/leveldb"
|
||||||
"github.com/btcsuite/goleveldb/leveldb/comparer"
|
"github.com/btcsuite/goleveldb/leveldb/comparer"
|
||||||
ldberrors "github.com/btcsuite/goleveldb/leveldb/errors"
|
ldberrors "github.com/btcsuite/goleveldb/leveldb/errors"
|
||||||
|
@ -26,6 +21,11 @@ import (
|
||||||
"github.com/btcsuite/goleveldb/leveldb/iterator"
|
"github.com/btcsuite/goleveldb/leveldb/iterator"
|
||||||
"github.com/btcsuite/goleveldb/leveldb/opt"
|
"github.com/btcsuite/goleveldb/leveldb/opt"
|
||||||
"github.com/btcsuite/goleveldb/leveldb/util"
|
"github.com/btcsuite/goleveldb/leveldb/util"
|
||||||
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
||||||
|
"github.com/lbryio/lbcd/database"
|
||||||
|
"github.com/lbryio/lbcd/database/internal/treap"
|
||||||
|
"github.com/lbryio/lbcd/wire"
|
||||||
|
btcutil "github.com/lbryio/lbcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/database/internal/treap"
|
|
||||||
"github.com/btcsuite/goleveldb/leveldb"
|
"github.com/btcsuite/goleveldb/leveldb"
|
||||||
"github.com/btcsuite/goleveldb/leveldb/iterator"
|
"github.com/btcsuite/goleveldb/leveldb/iterator"
|
||||||
"github.com/btcsuite/goleveldb/leveldb/util"
|
"github.com/btcsuite/goleveldb/leveldb/util"
|
||||||
|
"github.com/lbryio/lbcd/database/internal/treap"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue