func (s *WithdrawalStatus) InputAmounts() map[Ntxid]InputAmounts {
	return s.amounts
}
InputAmounts returns a map of ntxids to input amounts for every input in the tx
with that ntxid.
package votingpool
import (
	"bytes"
	"crypto/sha256"
	"fmt"
	"math"
	"reflect"
	"sort"
	"strconv"
	"time"
	"github.com/gcash/bchd/txscript"
	"github.com/gcash/bchd/wire"
	"github.com/gcash/bchutil"
	"github.com/gcash/bchwallet/waddrmgr"
	"github.com/gcash/bchwallet/walletdb"
	"github.com/gcash/bchwallet/wtxmgr"
)
const txMaxSize = 100000
const feeIncrement = 1e3
type outputStatus byte
const (
	statusSuccess outputStatus = iota
	statusPartial
	statusSplit
)
type OutBailmentID string
type Ntxid string
type OutputRequest struct {
	Address  bchutil.Address
	Amount   bchutil.Amount
	PkScript []byte
	Server string
	Transaction uint32
	cachedHash []byte
}
type WithdrawalOutput struct {
	request OutputRequest
	status  outputStatus
	outpoints []OutBailmentOutpoint
}
type OutBailmentOutpoint struct {
	ntxid  Ntxid
	index  uint32
	amount bchutil.Amount
}
type changeAwareTx struct {
	*wire.MsgTx
	changeIdx int32  
}
type WithdrawalStatus struct {
	nextInputAddr  WithdrawalAddress
	nextChangeAddr ChangeAddress
	fees           bchutil.Amount
	outputs        map[OutBailmentID]*WithdrawalOutput
	sigs           map[Ntxid]TxSigs
	amounts        map[Ntxid]InputAmounts
	transactions   map[Ntxid]changeAwareTx
}
type withdrawalInfo struct {
	requests      []OutputRequest
	startAddress  WithdrawalAddress
	changeStart   ChangeAddress
	lastSeriesID  uint32
	dustThreshold bchutil.Amount
	status        WithdrawalStatus
}
type TxSigs [][]RawSig
type InputAmounts []bchutil.Amount
type RawSig []byte
type byAmount []OutputRequest
func (u byAmount) Len() int           { return len(u) }
func (u byAmount) Less(i, j int) bool { return u[i].Amount < u[j].Amount }
func (u byAmount) Swap(i, j int)      { u[i], u[j] = u[j], u[i] }
type byOutBailmentID []OutputRequest
func (s byOutBailmentID) Len() int      { return len(s) }
func (s byOutBailmentID) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s byOutBailmentID) Less(i, j int) bool {
	return bytes.Compare(s[i].outBailmentIDHash(), s[j].outBailmentIDHash()) < 0
}
func (s outputStatus) String() string {
	strings := map[outputStatus]string{
		statusSuccess: "success",
		statusPartial: "partial-",
		statusSplit:   "split",
	}
	return strings[s]
}
func (tx *changeAwareTx) addSelfToStore(store *wtxmgr.Store, txmgrNs walletdb.ReadWriteBucket) error {
	rec, err := wtxmgr.NewTxRecordFromMsgTx(tx.MsgTx, time.Now())
	if err != nil {
		return newError(ErrWithdrawalTxStorage, "error constructing TxRecord for storing", err)
	}
	if err := store.InsertTx(txmgrNs, rec, nil); err != nil {
		return newError(ErrWithdrawalTxStorage, "error adding tx to store", err)
	}
	if tx.changeIdx != -1 {
		if err = store.AddCredit(txmgrNs, rec, nil, uint32(tx.changeIdx), true); err != nil {
			return newError(ErrWithdrawalTxStorage, "error adding tx credits to store", err)
		}
	}
	return nil
}
func (s *WithdrawalStatus) Outputs() map[OutBailmentID]*WithdrawalOutput {
	return s.outputs
}
func (s *WithdrawalStatus) Sigs() map[Ntxid]TxSigs {
	return s.sigs
}