func estimateRefundSerializeSize(contract []byte, tx *wire.MsgTx) int {
	baseSize := tx.SerializeSize()
	witnessSize := 5 + 73 + 33 + 1 + len(contract)
	return getVirtualSizeInner(baseSize, baseSize+witnessSize)
}
estimateRefundSerializeSize returns a worst case serialize size estimates for
a transaction that refunds an atomic swap P2SH output.
package main
import (
	"github.com/particl/partsuite_partd/wire"
)
const (
	redeemAtomicSwapSigScriptSize = 1 + 73 + 1 + 33 + 1 + 32 + 1
	refundAtomicSwapSigScriptSize = 1 + 73 + 1 + 33 + 1
)
const WITNESS_SCALE_FACTOR = 2
func sumOutputSerializeSizes(outputs []*wire.TxOut) (serializeSize int) {
	for _, txOut := range outputs {
		serializeSize += txOut.SerializeSize()
	}
	return serializeSize
}
func getVirtualSizeInner(sizeNoWitness int, sizeTotal int) int {
	return ((sizeNoWitness*(WITNESS_SCALE_FACTOR-1) + sizeTotal) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR
}
func getVirtualSize(tx *wire.MsgTx) int {
	return getVirtualSizeInner(tx.SerializeSizeStripped(), tx.SerializeSize())
}
func inputSize(sigScriptSize int) int {
	return 32 + 4 + wire.VarIntSerializeSize(uint64(sigScriptSize)) + sigScriptSize + 4
}
func estimateRedeemSerializeSize(contract []byte, tx *wire.MsgTx) int {
	baseSize := tx.SerializeSize()
	witnessSize := 6 + 73 + 33 + 32 + 1 + len(contract)
	return getVirtualSizeInner(baseSize, baseSize+witnessSize)
}