mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
Export the CheckTransactionInputs function.
This commit is contained in:
parent
e576962cb3
commit
3c7511a34b
1 changed files with 3 additions and 3 deletions
|
@ -579,7 +579,7 @@ func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkTransactionInputs performs a series of checks on the inputs to a
|
// CheckTransactionInputs performs a series of checks on the inputs to a
|
||||||
// transaction to ensure they are valid. An example of some of the checks
|
// transaction to ensure they are valid. An example of some of the checks
|
||||||
// include verifying all inputs exist, ensuring the coinbase seasoning
|
// include verifying all inputs exist, ensuring the coinbase seasoning
|
||||||
// requirements are met, detecting double spends, validating all values and fees
|
// requirements are met, detecting double spends, validating all values and fees
|
||||||
|
@ -587,7 +587,7 @@ func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block) error {
|
||||||
// amount, and verifying the signatures to prove the spender was the owner of
|
// amount, and verifying the signatures to prove the spender was the owner of
|
||||||
// the bitcoins and therefore allowed to spend them. As it checks the inputs,
|
// the bitcoins and therefore allowed to spend them. As it checks the inputs,
|
||||||
// it also calculates the total fees for the transaction and returns that value.
|
// it also calculates the total fees for the transaction and returns that value.
|
||||||
func checkTransactionInputs(tx *btcwire.MsgTx, txHeight int64, txStore TxStore) (int64, error) {
|
func CheckTransactionInputs(tx *btcwire.MsgTx, txHeight int64, txStore TxStore) (int64, error) {
|
||||||
// Coinbase transactions have no inputs.
|
// Coinbase transactions have no inputs.
|
||||||
if IsCoinBase(tx) {
|
if IsCoinBase(tx) {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
|
@ -797,7 +797,7 @@ func (b *BlockChain) checkConnectBlock(node *blockNode, block *btcutil.Block) er
|
||||||
// bounds.
|
// bounds.
|
||||||
var totalFees int64
|
var totalFees int64
|
||||||
for _, tx := range transactions {
|
for _, tx := range transactions {
|
||||||
txFee, err := checkTransactionInputs(tx, node.height, txInputStore)
|
txFee, err := CheckTransactionInputs(tx, node.height, txInputStore)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue